Harness proD API Help
EPLAN.Harness.API.Occurrences.Workdesk Namespace / OccWdMultipleSeal Class / ElectricalOptions Property
Example
In This Topic
    ElectricalOptions Property (OccWdMultipleSeal)
    In This Topic
    Gets or sets the electrical options of this occurrence.
    Syntax
    public IList<ElectricalOption> ElectricalOptions {get; set;}
    Exceptions
    ExceptionDescription
    Api is not in an initialized state. You can get current state from EPLAN.Harness.API.HpdApi.Status property. If API is uninitialized, you can initialize it by calling EPLAN.Harness.API.HpdApi.Init 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