SaveCircuit
(method)
This method executes the Save Circuit command from the COM interface. Saves the reduced circuit in a directory with the specified name. The full path name of the Master.DSS file is return in the DSSText.Result property.
Example
% Create DSS object
DSSObject = actxserver('OpenDSSEngine.DSS')
if ~DSSObject.Start(0),
disp('Unable to start openDSS');
return
end;
DSSText = DSSObject.Text;
DSSCircuit = DSSObject.ActiveCircuit;
% Compile a model
DSSText.Command = 'Compile C:\myPath\myModel.dss';
DSSReduceCkt = DSSCircuit.ReduceCkt;
DSSMeters = DSSCircuit.Meters;
% gets the names of the first EM on the list
i = DSSMeters.First;
myEM = DSSMeters.Name;
% set the EM name for the reduction
DSSReduceCkt.EnergyMeter = myEM;
% command to keep load
DSSReduceCkt.KeppLoad = true;
% breaks loops first
DSSReduceCkt.DoLoopBreak();
% merge parallel lines
DSSReduceCkt.DoParallelLines();
% reduce
DSSReduceCkt.DoDefault();
% get the OpenDSS command
myStr = DSSReduceCkt.EditString;
% Saves the circuit after reduction
DSSReduceCkt.SaveCircuit('myNewCircuit');