Harness proD API Help
EPLAN.Harness.API.Occurrences.Workdesk Namespace / BaseWdRapidSpecialComponent Class / RapidPartAddPin Method
Example
In This Topic
    RapidPartAddPin Method (BaseWdRapidSpecialComponent)
    In This Topic
    Add a pin to the rapid part.
    Syntax
    public IPinBase RapidPartAddPin()

    Return Value

    An occurrence of the virtual pin.
    Exceptions
    ExceptionDescription
    This method is available only for rapid parts.
    Example
    The example shows how to add a pin to the connector which is a rapid prototype.
    // Initialize API
    HpdApi api = HpdApi.GetInstance();
    api.Init();
    
    // Open a project and a workdesk.
    Project project = api.OpenProject(@"c:\Projects\MyProject.hxproj");
    					
    Variant variant = project.GetVariants().FirstOrDefault();
    Designer designer = variant.GetWorkdesks().FirstOrDefault(d => d.Name == "Workdesk_1");
    designer.Open(false, false);
    
    IOccConnector connector = designer.GetAllOccurrences().OfType<IOccConnector>().FirstOrDefault(c => c.Name == "cn_00001");
    IPinBase pin = (connector as IRPAddPin).RapidPartAddPin();
    
    // Save changes and close documents.
    designer.Save();
    
    designer.Close();
    project.Close();
    See Also