Web dialog import/export
-
Here is a summary of my posts under Index of Identity eaten by the server crash on 22nd November. I have also made it a new topic as it seems to me to be of universal potential over and above namesets.
Thanks to Jim, Fredo6, Didier and others I have finally cobbled together some code that works ...
def findIndex() a = 0 entities = Sketchup.active_model.active_entities selection = Sketchup.active_model.selection entities.each do |entity| if entity.class == Sketchup;;Group || entity.class == Sketchup;;ComponentInstance if selection[0] == entity cmd = "coreSUDown('#{a}');" p cmd @dlg.execute_script (cmd) end a+=1 end end end
This interactive set-up provides the opportunity not only to access and analyse any attributes extracted from Sketchup (don't know how to extract them yet) but also any other input by others with different interests in the component or group selected. (These other disciplines can use standalone namesets if visualisation is not required.) In my view this is far better than exporting to Excel, because it is direct and accessible to any authorised person with a browser, locally and world wide.
Here is a video clip demonstrating what it does:
[flash=425,355:37e9rq6m]http://www.youtube.com/v/P7zUH0C47MA[/flash:37e9rq6m]
Working in the nameset UI the backup device can be used to highlight and manipulate components or groups in the Sketchup display, but interaction is not yet fully bilateral pending an attribute extraction solution.
Incidently, I am now working on a nameset device to animate entities to accurately model the process of construction from delivery to installation; this really has only been made practical with this ruby.
It would be good if there could be some kind of a switch that, when activated, can run this ruby directly on selection rather than from the context menu. Anyone know if this is possible?
Thanks
Chris
-
Chris, you can set up a SelectionObserverif you (your code) wants to be notified of a selection change.
-
That sounds interesting. Do you know of any better reference material, the one you tagged is mainly just headings. Please let me know if you have a moment to spare.
Chris
Advertisement