Unconnect conductors
Hello, im triying to unconnect conductors using scripts, at this moment im using the "setEndinId" instruction to do tha, but is not working
im working with the following code:
Dim cor: set cor = prj.CreatePinObject
cor.SetId connectorId
cor.SetEndPinId(1, 0)
cor.SetEndPinId(2, 0)
Was this Helpful?
-
In you're example you were setting the core using the connector. You needed to set the core ID equal to the core itself.
Example in VBScript. Caution... This will disconnect ALL wires in project.
Option Explicit
Dim e3 : Set e3 = CreateObject("CT.Application")
Dim job : Set job = e3.CreateJobObject()
Dim cab : Set cab = job.CreateDeviceObject()
Dim cor : Set cor = job.CreatePinObject()
e3.ClearOutputWindow
Dim j, cabCount, cabIds
cabCount = job.GetCableIds(cabIds)
e3.PutMessage "Number of cables: " & cabCount
For j = 1 to cabCount
Dim cabId : cabId = cab.SetId(cabIds(j))
Dim k, corCount, corIds
corCount = cab.GetAllCoreIds(corIds)
For k = 1 to corCount
Call DisconnectWire(corIds(k))
Next
Next
Sub DisconnectWire(corId)
cor.SetId corId
Call cor.SetEndPinId(1, 0)
Call cor.SetEndPinId(2, 0)
End SubWas this Helpful?
0 -
Thank you! that is working, but for some reason when I'm trying to unconnect connectors using scripts that are placed in formboard takes more time than when I do it manually.
Do you know which can be the reason?
Was this Helpful?
0 -
Sorry. I don't know the reason.
Was this Helpful?
0
Please sign in to leave a comment.
Comments
3 comments