Volume of a dc?

As per your redraw solution, use ruby to extend the power of your DC

Sketchup.active_model.selection.grep(Sketchup::ComponentInstance).each do |s|
    if s.volume>-1
      s.set_attribute "dynamic_attributes","vol_inch", s.volume 
      s.set_attribute "dynamic_attributes","volume", "0"
      s.set_attribute "dynamic_attributes", "_volume_access","VIEW"
      s.set_attribute "dynamic_attributes","_volume_formlabel","Volume (cubic ft) " 
      s.set_attribute "dynamic_attributes","_volume_formula", "ROUND(vol_inch/1728,2)"
    end     
       $dc_observers.get_latest_class.redraw_with_undo(s)
 end
2 Likes