public IOccRapidLatentWire DeactivateCableWire()
Return Value
Occurrence of latent wire
// 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 wire. IOccCable cable = designer.GetAllOccurrences().OfType<IOccCable>().FirstOrDefault(c => c.Name == "ca_00004"); IWireCommon wire = cable.CableSubParts.OfType<IWireCommon>().FirstOrDefault(w => w.Name == "Wire:1"); // Deactivate the wire. IOccLatentWire deactivatedWire; if (wire is IOccCableWire cableWire) { deactivatedWire = cableWire.DeactivateCableWire(); } // Save changes and close documents. designer.Save(); designer.Close(); project.Close();