## ## Get a list of connectors, and for each, list the domains connected ## 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 } { set dbs [list] puts "Average Spacings of selected connectors in increasing order:" foreach con $cons { set name [$con getName]; set avgsp [$con getAverageSpacing] lappend dbs [ format "%f : %s" $avgsp $name ] } set sortedDbs [ lsort $dbs] set lengthOfList [ llength $sortedDbs ] for { set i 0 } { $i < $lengthOfList } { incr i } { puts [ lindex $sortedDbs $i ] } unset dbs; unset sortedDbs; unset i; unset con; unset name; unset avgsp } #================================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] "