# # Run this after import: it selects all the models, and moves these each to a separate layer, assigning the model's name to the layer package require PWI_Glyph 2.17.3 set numberOfDbs [pw::Database getCount] set listOfDbs [pw::Database getAll] set thisLayer 1 puts [ format "Sorting through %d database items ..." $numberOfDbs ] set counter 0 set numberOfModels 0 foreach thisDb $listOfDbs { incr counter set isModelFlag [ $thisDb isOfType pw::Model ] #puts [ format "flag %d for item %d" $isModelFlag $counter] if { $isModelFlag } { incr numberOfModels set name [$thisDb getName] set thisCollection [pw::Collection create] $thisCollection set [list $thisDb] $thisCollection do setRenderAttribute FillMode Shaded $thisCollection do setLayer $thisLayer pw::Layer setDescription $thisLayer $name pw::Display hideLayer [list $thisLayer] incr thisLayer $thisCollection delete } } pw::Display setCurrentLayer $thisLayer pw::Display hideAllLayers puts [ format "Done - assigned %d models to individual layers, turned off all layers, set current layer to %d." $numberOfModels $thisLayer ] exit