Return Value
An occurrence of the virtual pin.
Exception | Description |
---|---|
EPLAN.Harness.API.Exceptions.NotSupportedException | This method is available only for rapid parts. |
// 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();