2 September 2022
Online Help - GetIncidentElements
Download the macros example
Determining the number of inlets and outlets in a node (VBScript)
Using a macro, we get all the edges entering and exiting the node.
Sub GetCountIncident
'Object to show in the output window
Set Out = Zulu.OpenOutputChannel("Output")
'Clear the output window
Out.Clear
'Get the active layer of the current map
Set L = Zulu.ActiveMapDoc.Layers.Active
'Get a list of objects to check, look for objects with type 6
Set uzel = L.ElementKeys.SelectByType(6,0)
'in a loop, go through all the objects to check
For i=1 to UZEL.Count
'Determine the number of inlets and outlets
InzIN = L.GetIncidentElements (uzel.Item(i), 1).Count
InzOUT = L.GetIncidentElements (uzel.Item(i), 2).Count
'show the number of inlets and outlets in the output window
Out.Put "ID="& uzel.Item(i) & chr(10) & " Inlets = " & InzIN & chr(10) &" Outlets = "& InzOUT & chr(10)
next
MsgBox "done"
End sub
Online Help - GetIncidentElements
Download the macros example