EBDN - Community - Question & Answers

  Friday, 13 March 2020
  2 Replies
  835 Visits
0
Votes
Undo
Hi there,

how can I create the auto wires with VBA.
I would have suspected the wizard under the macros, but I can't find the macro there.

Does somebody has any idea


Sub createAutoWire()

Dim StartObjProj As ObjectItem
Dim pProj As Project

Set StartObjProj = Application.Selection.Item(1)
If Selection.Item(1).Kind <> aucObjProject Then
Exit Sub
End If
Set pProj = StartObjProj

pProj.State = aucProjectStateExclusive
'here create AutoWires
pProj.State = aucProjectStateShared

End Sub