Get Dimmensions plugin
-
Can somebody improve this very useful plugin? When the component is not aligned with the wold coordinates the reported dimensions are not accurate! Thanks in advance!
-
Use .local_bounds instead of .bounds to get the BB in the first place.
boundingBox = model.selection[0].local_bounds
Wait... that doesn't seem to account for scaling... so it's not what I thought.
-
This is based on code from Didier and TIG. It should work for selected Groups and Instances in any context, although I only tried it at model level.
model = Sketchup.active_model entities = model.entities selection = model.selection e = selection[0] scale_x = ((Geom;;Vector3d.new 1,0,0).transform! e.transformation).length scale_y = ((Geom;;Vector3d.new 0,1,0).transform! e.transformation).length scale_z = ((Geom;;Vector3d.new 0,0,1).transform! e.transformation).length bb = nil if e.is_a? Sketchup;;Group bb = Geom;;BoundingBox.new e.entities.each {|en| bb.add(en.bounds) } elsif e.is_a? Sketchup;;ComponentInstance bb = e.definition.bounds end if bb width = bb.width * scale_x depth = bb.depth * scale_z height = bb.height * scale_y puts "#{width}, #{height}, #{depth}" end
-
Thanks, but where to put this code?
-
could someone post a screen shot of what this plug does? sounds very interesting.
-
Just pops a dialog showing the dimensions of the selected Group or Component.
-
@xrok1 said:
could someone post a screen shot of what this plug does? sounds very interesting.
-
ahh, bounding box dimensions. i was hoping it was some kind of auto dimesioning thing.
thanks guys. -
I sent a plugin to dedmin to try. It shows the dimensions of a selected group or instance correctly eve when scaled and rotated. I'll post it when I hear back.
-
Plugin posted here: http://forums.sketchucation.com/viewtopic.php?f=323&t=28851
Advertisement