Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Designer Class / PlaceNonGraphicalAccessory Method
Library part to be placed as a non-graphical accessory.
An occurrence which the accessory will be attached to.
Example
In This Topic
    PlaceNonGraphicalAccessory Method
    In This Topic
    Place a non-graphical accessory and attach it to a part.
    Syntax
    public IAccessoryBase PlaceNonGraphicalAccessory( 
       BaseLibraryPart part,
       I3DOccurrence targetOccurrence
    )

    Parameters

    part
    Library part to be placed as a non-graphical accessory.
    targetOccurrence
    An occurrence which the accessory will be attached to.

    Return Value

    Created accessory occurrence.
    Exceptions
    ExceptionDescription
    Argument is invalid. The exception is thrown when a wrong argument is passed to the method or the setter of property.
    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.
    This file is not opened.
    Example
    This example shows how to place a non-graphical accessory to a connector in the workspace.
    // Obtain the workspace beforehand.
    Workspace workspace = ...
    
    // Find connector with name cn_00003.
    BaseOccurrence occurrence = workspace.GetAllOccurrences().FirstOrDefault(occ => occ.Name.ToString() == "cn_00003");
    
    // Use accessory from library.
    BaseLibraryPart accessory = ...
    
    // Place accessory to the specified connector.
    IAccessoryBase accessory = doc.PlaceNonGraphicalAccessory(accessory, occurrence);
    See Also