package require PWI_Glyph 2.3 # # Get dbExtents, get Model Size and print information # proc checkModelSize { } { set dbExtents [ pw::Database getExtents ] set thisModelSize [ pw::Database getModelSize ] set vectorMin [ lindex $dbExtents 0 ] set x1 [ lindex $vectorMin 0 ] set y1 [ lindex $vectorMin 1 ] set z1 [ lindex $vectorMin 2 ] set vectorMax [ lindex $dbExtents 1 ] set x2 [ lindex $vectorMax 0 ] set y2 [ lindex $vectorMax 1 ] set z2 [ lindex $vectorMax 2 ] puts [ format "Max of entities: (%s,%s,%s) " $x1 $y1 $z1 ] puts [ format "Min of entities: (%s,%s,%s) " $x2 $y2 $z2 ] set dbSize [ expr { ($x1 - $x2)**2 + ($y1 - $y2)**2 + ($z1 - $z2)**2 } ] set dbSize [ expr { sqrt($dbSize) } ] puts [ format "Span of current entities : %s" $dbSize ] puts [ format "Model size is currently set to: %s" $thisModelSize ] set thisRatio [ expr { ($thisModelSize/$dbSize) } ] puts [ format "Ratio is %s (recommended: 1) " $thisRatio ] return $thisRatio } set ratioModelDb [ checkModelSize]