Show volume on a DC

Show volume on a DC

Postby ReynaldoECG » Thu Oct 22, 2020 7:25 pm

Hi. I want to show the Volume of the geometry in a DC, to later calculate quantities and costs.
I used this code:

Code: Select all
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","volumen_mm", "0"
      s.set_attribute "dynamic_attributes", "_volumen_mm_access","VIEW"
      s.set_attribute "dynamic_attributes","_volumen_mm_formlabel","Volume (cubic ft) "
      s.set_attribute "dynamic_attributes","_volumen_mm_formula", "ROUND(vol_inch*16387.064,3)"

Works. But when I modify the geometry the volume does not change.
Is there a way to get the volume in a DC constantly and dynamically as the geometry changes?


Re: Show volume on a DC

Postby pcmoor » Mon Nov 02, 2020 1:50 am



SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Ad Machine 


Return to Dynamic Components

Who is online

Users browsing this forum: No registered users and 9 guests