## ## Get a list of domains, and for each, list the blocks connected ## package require PWI_Glyph 2.3 # procedure to let the user select connectors # returns a list of such connectors proc selectDomains { } { set conMask [pw::Display createSelectionMask -requireDomain [list] ] pw::Display selectEntities \ -description "Select the domains you want to list" \ -selectionmask $conMask selection set doms $selection(Domains) } proc listDoms { doms } { set dbs [list] foreach dom $doms { set name [$dom getName] puts [ format "%s used by" $name ] set connectedBlocks [pw::Block getBlocksFromDomains $dom] set numberofconnectedBlocks [llength $connectedBlocks] set iNum 0 foreach thisBlock $connectedBlocks { set blockName [$thisBlock getName] set layerOfBlock [$thisBlock getLayer] set iNum [ expr { $iNum + 1} ] puts [ format " %4d: %s (Layer %d)" $iNum $blockName $layerOfBlock ] } puts " " } } #================================Start processing============================== # Start timer set startTime [clock seconds] set doms [selectDomains ] listDoms $doms # 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] "