Harness proD API Help
EPLAN.Harness.API.Occurrences.CableDrawing Namespace / BaseCdConnectableObject Class / ElectricalOptions Property
Example
In This Topic
    ElectricalOptions Property (BaseCdConnectableObject)
    In This Topic
    Gets or sets the electrical options of this occurrence.
    Syntax
    public IList<ElectricalOption> ElectricalOptions {get;}
    Exceptions
    ExceptionDescription
    Api is not in an initialized state. You can get current state from Status property. If API is uninitialized, you can initialize it by calling Init(String,String[]) method. If API is in failed state, you can not resurrect it.
    The object is in invalid state. Obtain a new one.
    The exception that is thrown when you trying to access to already deleted occurrence.
    Argument is invalid. The exception is thrown when a wrong argument is passed to the method or the setter of property.
    Remarks

    Consists of:

    Example
    This example shows how to set an electrical option as active.
    // Obtain the occurrence before.
    OccWsPin pin = ...
    
    // Get the electrical options of this occurrence.
    IList<ElectricalOption> elOptions = pin.ElectricalOptions;
    
    // Set 'Option: 1' as active.
    ElectricalOption option = elOptions.FirstOrDefault(o => o.Name == "Option: 1");
    
    if(option == null)
    	// Resolve this issue.
    
    option.IsUsed = true;
    
    pin.ElectricalOptions = elOptions;
    See Also