Webdialog component and group html attributes
-
I am trying to make a webdialog that updates with the selection, just like component options does, and sets the content of the attribute: ("dialog_product","html_code","#{value}").
So basicly, the dialog will be like a webpage for the component, the html is the valueDictionary;dialog_product Name;html_code Value;<html><body><a href=""><i>BUY HERE!!! 0.5mm x 0.37mm</i></a></body></html>,the dialog, that updates with the selection, will do that value. Could someone help me?
-
Normally, you would wish to use an Observer to "make changes happen" in your webdialog.. however the SelectionObserver is still bugged.
-
You may try using the onSelectionBulkChange callback of a SelectionObserver custom subclasss, to trigger your changes. Then use the query methods of the Selection collection class (http://code.google.com/apis/sketchup/docs/ourdoc/selection.html) to determine if the selection is a single object (method single_object?), and if so test if it is an instance of Sketchup::ComponentInstance, and if it is.. whether it has an attribute dictionary of a certain name, and if so, make your changes.
-
@dan rathbun said:
Then use the query methods of the Selection collection class (http://code.google.com/apis/sketchup/docs/ourdoc/selection.html) to determine if the selection is a single object (method single_object?)
Note that
single_object?will return true if you have a surface selected- which is multiple faces. To check if the selection really contains only one entity use thelengthproperty. -
Thanks, guys. I Hope I can get this to work.

Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement