# # loops thrpugh all domains in the model file, checks for domains 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 listOfDomains [pw::Grid getAll -type "pw::Domain" ] foreach dom $listOfDomains { set thisExam [pw::Examine create DomainEdgeLength] $thisExam addEntity [ list $dom ] $thisExam examine set thisMinVal [$thisExam getMinimum -entity thisMinVar -location thisMinLoc] if { $thisMinVal <= $cutoffValue } { set thisMinName [$thisMinVar getName] set thisMinLayer [$thisMinVar getLayer] puts [format " Found Domain = %s (layer %d)" $thisMinName $thisMinLayer ] set thisCollection [pw::Collection create] $thisCollection set [list $dom] $thisCollection do setLayer $targetLayer $thisCollection delete } $thisExam delete unset thisExam }