Harness proD API Help
EPLAN.Harness.API.Common Namespace / Extensions Class / AddToCableUnit Method
EPLAN.Harness.API.Occurrences.Interfaces.ICableUnitAddable occurrence.
Cable unit to which you want to add this occurrence.
If true, all occurrences related to this one are also added. Default is true.
Example
In This Topic
    AddToCableUnit Method (Extensions)
    In This Topic
    Add this occurrence to the cable unit.
    Syntax
    [Extension()]
    public static void AddToCableUnit( 
       ICableUnitAddable occ,
       IOccCableUnit cableUnit,
       bool includeRelated
    )

    Parameters

    occ
    EPLAN.Harness.API.Occurrences.Interfaces.ICableUnitAddable occurrence.
    cableUnit
    Cable unit to which you want to add this occurrence.
    includeRelated
    If true, all occurrences related to this one are also added. Default is true.
    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.
    Thrown when the occurrence and the cable unit are not part of the same document.
    The exception is thrown in case of attempt to access a property or a method which is not supported on the current instance of the object.
    Example
    This example shows how to add this occurrence (and all its related occurrences) to a cable unit.
    ICableUnitAddable occurrence = ...
    IOccCableUnit cableUnit = ...
    
    occurrence.AddToCableUnit(cableUnit);
    This example shows how to add this occurrence to a cable unit.
    ICableUnitAddable occurrence = ...
    IOccCableUnit cableUnit = ...
    
    occurrence.AddToCableUnit(cableUnit, false);
    See Also