Is there an observer to catch the 'event' when a user applies a change to a dynamic component that causes it to redraw? I need to beable to force a redraw of another dynamic component if a change happens to another. I thought I saw something on a dynamic component observer, but I cannot find any documentation on it...
Thanks,
Jon
Dynamic Component Redraw
10 posts
• Page 1 of 1
Re: Dynamic Component Redrawwell supposedly the refresh method will force a redraw. Did you try that method? It might need to be implemented inside of a tool class. Did you look into that method?
Chris
Re: Dynamic Component Redraw
He need the refresh method and an event callback... Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: Dynamic Component RedrawI think it should be possible. The operation of DC's are not documented, but this blog post might contain some useful examples.
http://sketchupapi.blogspot.com/2009/07 ... scene.html Hi
Re: Dynamic Component RedrawHey guys,
There is no observer for DC redraw. I did think of a trick you could try, however. The "functions" that can be called as part of a DC formula are defined in a class called DCFunctionsV1. Any protected methods inside that class are discovered by the DC plugin by reflection and can be called inside a DC spreadsheet formula. Since every formula is run each time a DC is redrawn, you can call your own ruby code this way. For example, let's make a new DC spreadsheet function that shows a messagebox: 1. Save this script as customDCFunctions.rb into your plugins directory.
2. Restart SU, and create a new DC. Add a custom attribute called "onredraw" (or whatever you want) with the following formula:
Whenever that DC is redrawn (manipulate it with the scale tool, for example), you'll see your messagebox. You could just as easily call some more complex code. People who have your script installed will get the behavior you want. People without it won't, of course, so you'd need to be careful about that. Hope that gets you started. ![]() Re: Dynamic Component RedrawMany thanks Scott, Thom and Chris. I will give this a try when I get back to the workstation.
|
Who is online
Users browsing this forum: sgraf and 12 guests