Apply component attributes changes

272 views
Skip to first unread message

Tri Vosem

unread,
Oct 15, 2013, 5:35:37 PM10/15/13
to sketch...@googlegroups.com
hello

I have dynamic component in the scene, it has some attributes,
if I change some of them through the Context menu -> Dynamic Components -> Component Attibutes then I can see corresponding changes of component
but if I do it in the ruby using component.set_attribute('dynamic_attributes',...  then I see no changes of the component

how to fix it?

Richard Oliveri

unread,
Oct 16, 2013, 10:15:20 PM10/16/13
to sketch...@googlegroups.com
You have to redraw the instances of the component after you change the attributes.
I've redrawn components by using the following Ruby code:

$dc_observers.get_latest_class.redraw_with_undo(ci)

Where "ci" is an instance of the component.

I hope this works for you.

Tri Vosem

unread,
Oct 22, 2013, 10:47:23 AM10/22/13
to sketch...@googlegroups.com
Thanks, this works

Roger Rosiers

unread,
Jan 16, 2017, 8:45:57 AM1/16/17
to SketchUp Ruby API
Hi, I'm trying to update DC attribute values too with ruby using component.set_attribute('dynamic_attributes',... but I'm not able. probably a scripting error. Would you mind to share you script? Highly appreciated!

Op dinsdag 22 oktober 2013 16:47:23 UTC+2 schreef Tri Vosem:

John Farrelly

unread,
Jan 19, 2017, 12:02:41 AM1/19/17
to sketch...@googlegroups.com
re  apply for code for google chrome

--
You received this message because you are subscribed to the Google Groups "SketchUp Ruby API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sketchupruby+unsubscribe@googlegroups.com.
To post to this group, send email to sketch...@googlegroups.com.
Visit this group at https://groups.google.com/group/sketchupruby.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages