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

    Wish List - WebDialog communication model

    Scheduled Pinned Locked Moved Developers' Forum
    16 Posts 7 Posters 2.1k Views 7 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.
    • A Offline
      Aerilius
      last edited by

      Very interesting topic! I agree that communication is not straight-forward (especially when we need to pass a lot of data and let JavaScript call a Ruby method so that Ruby reads a hidden text field in the WebDialog).

      A bit unrelated, but I created a small fake program "skp" and registered it in Firefox for the %(#000000)[skp:] protocol. this way I can debug Javascript and CSS without annoying error messages that Firefox does not know what to do with %(#000000)[skp:].

      1 Reply Last reply Reply Quote 0
      • chrisglasierC Offline
        chrisglasier
        last edited by

        Here and elsewhere communication models appear to be built on software solutions. A healthier approach is for the communication model to be designed to lead to software solutions. For example webdialogs can be software solutions for viewing communication models assembled by working the Internet as I suggested here and here.

        It is worth repeating the quote in that last post:

        All of the features of NLS were in support of Engelbart's goal of augmenting collective knowledge work and therefore focused on making the user more powerful, not simply on making the system easier to use.

        With this in mind I think it is very wrong to expect those gifted 3d modeling software designers to be responsible for communication modeling beyond the simplest of connections. Those who use Sketchup know what needs to be communicated for whatever they use it for yet there is little support for capturing and modeling their expertise - for example, why has builder Andrew Dwight had to go out on a limb?.

        With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

        1 Reply Last reply Reply Quote 0
        • aadbuildA Offline
          aadbuild
          last edited by

          thanks Chris, I am not sure if developing custom software is going out on a limb (unless Trimble removes access to the back end of Sketchup). I designed it for me to increase the amount of work that myself and other builders can get done in a day. We are all doing this in one way or another. I hope that the rest of the world will get to reap the benefits of my work in the future. I guess we will find out sooner or later.

          My 2 bobs worth is: you can only achieve a certain amount with ruby and using all languages is imperative considering the access we have to Sketchups rear end. πŸ˜„

          Every building designed can be affordable & buildable, to help we built PlusSpec; VDC & BIM for Sketchup

          https://www.plusspec.com

          1 Reply Last reply Reply Quote 0
          • chrisglasierC Offline
            chrisglasier
            last edited by

            @aadbuild said:

            thanks Chris, I am not sure if developing custom software is going out on a limb ...

            I don't think there was anything to thank me for, but have a read of this and its related posts. It may be you have put all your eggs in one basket - in which case you are very certainly out on a limb.

            Obviously I don't know the detail of your plug in but you mention some interaction with suppliers and so forth. You know most people have JavaScript enabled so if you are relying entirely on Ruby that may go against you. I would really think about minimising Ruby content to the simplest of bridges to Sketchup capturing and manipulating enabling data cross platform.

            With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

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

              Try building the protocol message as a single-quoted string ??

              Also.. the HTMl & codes are not valid in URIs, because & is used mark a field. Special characters should be replaced with %nn hexidecimal codes. ie & is %26

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • A Offline
                Aerilius
                last edited by

                @dan rathbun said:

                Try building the protocol message as a single-quoted string ??

                For simple messages yes, but if I can't predict what characters the message contains, I can't simply brute-force replace all double quotes by single quotes.
                I ended up writing my own escape function the gets rid of all characters that need escaping (be it for urls or string manipulation). The normal escape function would replace \ by \\ and " by \" which both could later require escaping again (\\\\\\\\\\\\ πŸ˜„ ).

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

                  I have encountered similar "hair-pulling" frustration with the UI.openURL method.

                  I'm not here much anymore.

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    Aerilius
                    last edited by

                    I'm again struggling with the skp: protocol. It is probably one of the biggest limitations:

                    • it supports only ~2083 characters in Internet Explorer
                    • it unescapes html named characters (JS sends %(#000080)["& &"] and Ruby receives "& &")
                      Edit: this is solved by using %(#000080)[encodeURIComponent()] on the whole string.
                    • It eats sometimes backslashes ( %(#000080)[\] as well as encoded as %(#000080)[%5C])
                    • If JS sends a single quote ( %(#000080)['] or %(#000080)[%27]), Ruby receives nil.
                    • On a JavaScript onunload event, we can only send data using this %(#000080)[skp] method, the more reliable webdialog.get_element_ value("hidden_field") method comes too late when the dialog is already closed.
                    1 Reply Last reply Reply Quote 0
                    • A Offline
                      Aerilius
                      last edited by

                      I've published a code snippet for many of these issues: http://forums.sketchucation.com/viewtopic.php?f=180&t=46626
                      Input appreciated.

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

                        @richmorin said:

                        As an example of quirky behavior, execute_script() imposes a fairly small (and undocumented) limit on the size of the executed code string. So, although the call can be used to transfer data (eg, as JSON), any significant amount of data will require multiple calls.

                        What is the limit? I was relying on this to push (sizeable) model data into a silverlight plugin in the WebDialog. I had assumed I needed to chunk, but it would really help to know what that limit is, so I can chunk to that size. πŸ˜„

                        Thanks!

                        1 Reply Last reply Reply Quote 0
                        • chrisglasierC Offline
                          chrisglasier
                          last edited by

                          @caseychamberlain said:

                          @richmorin said:

                          As an example of quirky behavior, execute_script() imposes a fairly small (and undocumented) limit on the size of the executed code string. So, although the call can be used to transfer data (eg, as JSON), any significant amount of data will require multiple calls.

                          What is the limit? I was relying on this to push (sizeable) model data into a silverlight plugin in the WebDialog. I had assumed I needed to chunk, but it would really help to know what that limit is, so I can chunk to that size. πŸ˜„

                          Thanks!

                          This is the overriding problem:

                          https://developers.google.com/sketchup/docs/ourdoc/webdialog#add_action_callback

                          With TBA interfaces we can analyse what is to be achieved so that IT can help with automation to achieve it.

                          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