(read only)


This property returns the Index into Controller list of OCP Device controlling the active circuit element.


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;

DSSLines = DSSCircuit.Capacitors;

% Compile a model        

DSSText.Command = 'Compile C:\myPath\myModel.dss';

DSSActiveElement = DSSCircuit.ActiveCktElement;

% Sets the first line of the list as the active element

if DSSLines.First > 0,

    % Check if there is an OCP tied to it

    HasOCP = DSSActiveElement.HasOCPDevice;

    if HasOCP,

        % Gets the OCP device index tied to the active element

        myOCPIdx = DSSActiveElement.OCPDevIndex;

    end;

else 

    disp('It seems that you have no lines!');

end;