IWireCommon RapidPartAddWire()
Return Value
An occurrence of the virtual or latent wire.
Exception | Description |
---|---|
EPLAN.Harness.API.Exceptions.NotSupportedException | This method is available only for rapid parts. |
// Initialize API HpdApi api = HpdApi.GetInstance(); api.Init(); // Open project and workdesk or workspace. 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); // Select cable occurrence and add a wire. IOccCable cable = designer.GetAllOccurrences().OfType<IOccCable>().FirstOrDefault(c => c.Name == "ca_00004"); IWireCommon addedWire = cable.RapidPartAddWire(); // Save changes and close documents. designer.Save(); designer.Close(); project.Close();