Trying to invoke a selection from a web dialog
-
Hello all, I am turning to the guru's here as I have spent too long on this. Here is what I am trying to do:
when my custom tool starts, invoke a web dialog.
on the wd, there is a button to "pick Z". The intention here is when the button is clicked, a callback will invoke "something" to allow the user to pick some entity (assuming some use of pick helper here). Then some parsing of the selection will allow the script to derive a Z value.
next that value needs to be sent back to the wd
This all seems like it should be simple, but I must admit I have not found the key yet. At this point I am not even sure what this will look like for a program flow stand point.
Any thoughts, questions, pointers are surely appreciated
-
Hi,
The chapter 13 of the great book "Automatic Sketchup" by Matthew Scarpino could be a good starting point with source code sample to start with. It contains I think all you need.
Yours
Pascal -
Hi Pascal, Thank you for taking a stab at my ill worded post. I forgot all about that book. I have downloaded it and read parts of chapter 13. I have made progress now (I am sending information back to my WD as a result of picking something), but I did this by making my web dialog global. $wd instead of wd. So clearly my real issue here is losing scope of my objects. Thank you for your suggestion as chapter 13 pointed me to the $wd.
-
I am not impressed with that book, at all.
Using global variables is a no-no.
Choose a name for your top level module, and write all your code within your own module namespace. Then use @vars (instance variables,) or @@vars (module variables.)
Often we make each of our plugins in a sub-module of our toplevel author module.
Advertisement