# # loops through all blocks in the model file, checks for those that # match / satisfy a rule, and move these to a target layer # # Edit the code to modify the rule and/or the target layer package require PWI_Glyph 2.17.3 set cutoffValue 1E-4 set targetLayer 999 set listOfBlocks [pw::Grid getAll -type "pw::Block" ] foreach thisBlock $listOfBlocks { set thisExam [pw::Examine create BlockEdgeLength] $thisExam addEntity [ list $thisBlock ] $thisExam examine set thisMinVal [$thisExam getMinimum -entity thisMinVar -location thisMinLoc] if { $thisMinVal <= $cutoffValue } { set thisMinName [$thisMinVar getName] set thisMinLayer [$thisMinVar getLayer] puts [format " Found Block = %s (layer %d)" $thisMinName $thisMinLayer ] set thisCollection [pw::Collection create] $thisCollection set [list $thisBlock] $thisCollection do setLayer $targetLayer $thisCollection delete } $thisExam delete unset thisExam }