Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download
Apply changes when click on the element
-
Hello guys, need some help again.
Scenario:
Have two entities selected, and when I click in my plugin need to calculate the sum of both selected LenX and apply this value on the next entity that i'll click. Like image below:

My code until now:
model = Sketchup.active_model selections = model.selection lenx_total = 0.to_i leny_total = 0.to_i lenz_total = 0.to_i if selections.empty? UI.messagebox('Select at least one component.') else selections.each do |sel| lenx_total = lenx_total + sel.definition.get_attribute('dynamic_attributes', '_lenx_nominal') end end # All this is for test only, where i'm stuck and trying to discover something model.find_entity_by_id(18618).definition.set_attribute 'dynamic_attributes', '_lenx_nominal', lenx_total new_def = model.find_entity_by_id(18618).definition model.place_component new_defThanks for your time.
Advertisement