Harness proD API Help
EPLAN.Harness.API.Occurrences.Workdesk Namespace / BaseWdAccessoryOccurrence Class / WireHarness Property
Example
In This Topic
    WireHarness Property (BaseWdAccessoryOccurrence)
    In This Topic
    Gets or sets the wire harness in which this occurrence is included.
    Syntax
    public IOccWireHarness WireHarness {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.
    Thrown when this property does not exist in this context.
    Argument is invalid. The exception is thrown when a wrong argument is passed to the method or the setter of property.
    Example
    This example shows how to set a new wire harness for anoccurrence.
    // Obtain the designer and occurrence before.
    Workspace workspace = ...
    OccWsWire wire = ...
    
    // Get all harnesses in this designer.
    IEnumerable<IOccWireHarness> harnesses = workspace.GetAllOccurrences().OfType<IOccWireHarness>();
    
    // Find the desired wire harness.
    IOccWireHarness desiredWireHarness = harnesses.FirstOrDefault(h => h.Name.Value == "harness_00001");
    
    if(desiredWireHarness == null)
    {
    	// Resolve this issue...
    }
    
    wire.WireHarness = desiredWireHarness;
    See Also