package require PWI_Glyph 2.3 # procedure to let the user select connectors # returns a list of such connectors proc selectConnectors { } { set conMask [pw::Display createSelectionMask -requireConnector [list] \ -blockConnector "Pole"] pw::Display selectEntities \ -description "Select the connectors you want to list" \ -selectionmask $conMask selection set cons $selection(Connectors) } proc listCons { cons } { foreach con $cons { puts [ format "Connectors connected to %s ..." [ $con getName] ] puts " ... at End: " set node [$con getNode End] foreach cnctr [pw::Connector getConnectorsFromNode $node] { puts [ format " %s (Dimension: %d) (Layer: %s)" [$cnctr getName] [$cnctr getDimension] [$cnctr getLayer] ] } puts " ... at Start: " set node [$con getNode Begin] foreach cnctr [pw::Connector getConnectorsFromNode $node] { puts [ format " %s (Dimension: %d) (Layer: %s)" [$cnctr getName] [$cnctr getDimension] [$cnctr getLayer] ] } } unset con; unset node; unset cnctr } #================================Start processing============================== # Start timer set startTime [clock seconds] set cons [selectConnectors ] set sortedcons [list] set sortedcons [lsort $cons] # listCons $cons listCons $sortedcons # End timer set endTime [clock seconds] puts "" puts "Script executed in [expr $endTime-$startTime] seconds, [clock format $startTime -format %H:%M:%S], [clock format $startTime -format %D] "