to reproduce my problem in SU2017 do the following:
Open a new Sketchup model (with Chris or create a box and transform it to Component)
Paste the code in the console
inst = Sketchup.active_model.entities.grep(Sketchup::ComponentInstance)[0]
# Add the ScaleTool behavior and enable only scaling along z axis
inst.definition.set_attribute 'dynamic_attributes', 'scaletool', "123"
# Change the z-length to 200
inst.definition.set_attribute 'dynamic_attributes', 'lenz', 200.to_f
# Trigger a redraw
$dc_observers.get_latest_class.redraw_with_undo inst
Nothing happens. I can see with the Attribute Visualizer Plugin (or inst.definition.set_attribute 'dynamic_attributes', 'lenz') that the value of lenz is indeed set to 200, but the component isn’t scaled up, even after manually triggering a redraw…
When I edit the lenz value manually with the Dynamic Component Attributes window it does scale the component correctly.
I believe that when an instance’s geometric (len, scale, etc.) parameters will vary from the definition defaults, that you need to make the change to the instance’s “dynamic_attributes” dictionary. (Limiting scaling to certain axes should be okay in the definition’s dictionary.)
before, but that didn’t change any behavior. I tried different attributes, number formats, different components and orders, but I can’t get the component to change with using the API.