sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Trying to invoke a selection from a web dialog

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 311 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      cncmachineguy
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • ppoublanP Offline
        ppoublan
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • C Offline
          cncmachineguy
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • Dan RathbunD Offline
            Dan Rathbun
            last edited by

            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.

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement