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

    [Plugin] VisMap - Layer/Scene Visibility Map

    Scheduled Pinned Locked Moved Plugins
    126 Posts 15 Posters 50.3k Views 15 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.
    • M Offline
      MartinRinehart
      last edited by

      @markozeta said:

      this would request a url from internet explorer that would contain a 2,150 character string attached to an 11 character header to form a 2,161 character url - which exceeds IE's ( 🤢 ) limits.

      Thanks!

      I've done a lot with bit maps, so packing 16k bits into a 2k string is not a problem. But is 16k going to handle really large animations? Or should I find (they're there) a more capacious solution?

      Edit: "The data area passed to a system call is too small." Remember? That's the 2k data area that IE is trying to fit 2k+ bytes into.

      Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

      1 Reply Last reply Reply Quote 0
      • EdsonE Offline
        Edson
        last edited by

        @martinrinehart said:

        Do you know anything about Ruby or JavaScript?

        very little. however, i have been able to run tests for other coders when there was any problem about running scripts on mac. but i would have to be guided for that to work.

        edson mahfuz, architect| porto alegre • brasil
        http://www.mahfuz.arq.br

        1 Reply Last reply Reply Quote 0
        • M Offline
          MartinRinehart
          last edited by

          Edson,

          Two attachments. "house.skp" is my test model. Try to VisMap it. If it works, then it's your models. Please send me the smallest one on which VisMap fails. Ignore the second file.

          Leave "house.skp" loaded in SU if the above fails. "vismap.txt", which you must rename to "vismap.js", is the JavaScript but it is tricked out to not call the Ruby. Instead, it simulates the Ruby return of data appropriate to "house.skp". Save it to /dir/of/your/su/Plugins/vismap/ as "vismap.js" (UL'd as "vismap.txt" because this board won't permit ".js" files.) If it succeeds, then we have a problem in the Ruby code. If it fails, then we have a problem with the JavaScript. Let me know.

          Martin


          test model


          tricked out JavaScript

          Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

          1 Reply Last reply Reply Quote 0
          • EdsonE Offline
            Edson
            last edited by

            martin,

            i opened your model and the vismap UI was still blank. then i did as you asked me to: downloaded the other file, renamed it and put it in the proper folder. it worked: the UI appeared with the info related to house.skp. however, it did not work with any of my models. closing and opening the vismap window again while in your file works but it takes along for the info to appear.

            do you want me to send you my model?

            edson mahfuz, architect| porto alegre • brasil
            http://www.mahfuz.arq.br

            1 Reply Last reply Reply Quote 0
            • M Offline
              MartinRinehart
              last edited by

              @edson said:

              do you want me to send you my model?

              I don't think so. The fact that you couldn't VisMap my model but you could VisMap with the tricked out JavaScript pretty much isolates the Ruby code as the villain. Ruby has a good reputation for being truly multi-platform. (Unlike JavaScript, where MSFT resolutely refuses to follow standards.)

              Hmmmm.

              Off topic: Speaking of things I don't know, where is Brazil in world tennis? I would have expected a wave to follow Kuerten.

              On topic: Hmmmm. I'll think of something. (I hope.)

              Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

              1 Reply Last reply Reply Quote 0
              • takesh hT Offline
                takesh h
                last edited by

                Hi Martin,
                Since I was having the blank dialog box problem too (in my case, I had to go to another program once and come back to SU to get Vismap display right), I tried the above house.skp and vismap.js files.
                with house.skp, vismap showed a small blank dialog box first, so I dragged its edge to maxmize it and the content of the box appeared.
                So I installed vismap.js. With it, vismap showed dialog box right, although it was small at the beginning.
                Then funny things started happening. I opened several of my own models and tried vismap, but it kept showing the layer structure of house.skp! Now this is weird.

                1 Reply Last reply Reply Quote 0
                • M Offline
                  MartinRinehart
                  last edited by

                  @takesh h said:

                  I opened several of my own models and tried vismap, but it kept showing the layer structure of house.skp! Now this is weird.

                  That was a tricked out vismap.js. It's trick was to pretend to call Ruby and then provide the Ruby's answer - appropriate to house.skp. The idea was to test that the JavaScript was working correctly, which it was.

                  DL the .zip again. You'll get a straight JavaScript and a better Ruby.

                  Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    MSP_Greg
                    last edited by

                    Martin,

                    I don't use scenes much, but congrats on your plug-in (I thought you said it was your first somewhere.)

                    For loading and unloading models, you may want to use the Sketchup::AppObserver and hook the onOpenModel(model) and onNewModel(model) events.

                    Secondly, you might consider wrapping all your code in a module and use 'self' for the methods, and using 'private' to control for external visibility. Helps with 'namespace type' collisions.

                    Lastly, I put the html as a string in my rb/rbs files and load it with dialog.set_html. It's easy to change the font size in the (inline) CSS before loading it in the dialog box, and I used 'em' for all the html size/layout units. HTML needs the same kind of escaping as strings passed between ruby and javascript.

                    HTH,

                    Greg

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      markozeta
                      last edited by

                      @unknownuser said:

                      I've done a lot with bit maps, so packing 16k bits into a 2k string is not a problem. But is 16k going to handle really large animations? Or should I find (they're there) a more capacious solution?

                      If you're able to pass it as 32 bits/char, you could get 256^2 bits in. That would work for what I'm trying to do (make a decent pipe system of 200+ pieces and pass it to layout), but might not pass for animation work.

                      Make it a pro version and a free version, pro being for animation with a different data passing technique?

                      BSME - Cal Poly Pomona
                      Sketchup Pipe Maniac

                      1 Reply Last reply Reply Quote 0
                      • M Offline
                        MartinRinehart
                        last edited by

                        @markozeta said:

                        If you're able to pass it as 32 bits/char, you could get 256^2 bits in.

                        The limit is 2kB in the URL: 16k bits. I'm working on the code right now to pack 6 bits per byte which you can do with the printable ASCII characters, so it should be totally dependable and give you 12k scene/layer combinations.

                        @markozeta said:

                        Make it a pro version and a free version, pro being for animation with a different data passing technique?

                        I like this thinking!

                        Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                        1 Reply Last reply Reply Quote 0
                        • M Offline
                          MartinRinehart
                          last edited by

                          Thanks for all the good ideas. I'm already pretty clean, namespace wise. (Only one public var, $vismap_model).

                          @msp_greg said:

                          Lastly, I put the html as a string in my rb/rbs files and load it with dialog.set_html.

                          That's a very interesting idea!

                          Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                          1 Reply Last reply Reply Quote 0
                          • M Offline
                            MSP_Greg
                            last edited by

                            Martin,

                            I'm already pretty clean, namespace wise. (Only one public var, $vismap_model).

                            I was referring to procedure / function / class visibility, not variable visibility.

                            For instance, 'Model' may not be the best unqualified name for a class. IOW, what if someone has a lot of installed plug-ins? You don't want name resolution issues...

                            Thanks,

                            Greg

                            1 Reply Last reply Reply Quote 0
                            • Bob JamesB Offline
                              Bob James
                              last edited by

                              This plugin has terrific potential for my work! I often have 50 or more layers and 10 or more scenes and, although "add hidden layer" is a great help, this plugin would be super for changing things later on in the process.

                              It worked perfectly with a small test model, but when I applied it to my current large model all I got was a blank dialog box. I tried all kinds of "open, close, scene update, save, etc. tricks", even the right click "reload".

                              This is on a MacPro.


                              Works fine for small test model


                              Does not work for large model (not all layers are shown)

                              i7-4930K 3.4Ghz, 2x GTX780 6GB, 32GB DDR3-1600 ECC, OCZ Vertex 4 500GB, WD Black 3TB, 32TB NAS, 4x 27" Monitors, SpaceMouse Pro, X-keys XK-60

                              1 Reply Last reply Reply Quote 0
                              • takesh hT Offline
                                takesh h
                                last edited by

                                @bob james said:

                                It worked perfectly with a small test model, but when I applied it to my current large model all I got was a blank dialog box. I tried all kinds of "open, close, scene update, save, etc. tricks", even the right click "reload".

                                Bob, I am also on a Mac and having a similar problem.
                                In my case, when VisMap spreadsheet is bigger than dialog box, one of the followings will fix the visibility issue;

                                1. Move the dialog box then size-drag to fit VisMap spreadsheet.
                                2. Go to another program and come back, then resize the dialog box.
                                  Hope it helps.
                                1 Reply Last reply Reply Quote 0
                                • M Offline
                                  MartinRinehart
                                  last edited by

                                  @bob james said:

                                  when I applied it to my current large model all I got was a blank dialog box.

                                  See my exchanges w/Edson. Known Mac issue, now tracked to the Ruby code.

                                  Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                                  1 Reply Last reply Reply Quote 0
                                  • M Offline
                                    MartinRinehart
                                    last edited by

                                    Edson,

                                    Drop attachment 1 into your .../Plugins/vismap subdir, open the Ruby Console and try again to vismap "house.skp".

                                    The result should look like attachment 2. (The addresses - :0xhhhhhhh - will be totally different, but the rest will be the same up to the point of the failure.)

                                    Have I thanked you adequately for your help and patience? Both are truly appreciated.

                                    Martin


                                    verbose Ruby code


                                    Ruby Console output

                                    Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                                    1 Reply Last reply Reply Quote 0
                                    • EdsonE Offline
                                      Edson
                                      last edited by

                                      martin,

                                      no need to thank me. by helping you i am also helping myself and many others who will benefit from your plugin.

                                      i followed your instructions. see the attached file below for the result.


                                      edson_vismap.txt

                                      edson mahfuz, architect| porto alegre • brasil
                                      http://www.mahfuz.arq.br

                                      1 Reply Last reply Reply Quote 0
                                      • M Offline
                                        MartinRinehart
                                        last edited by

                                        @msp_greg said:

                                        For instance, 'Model' may not be the best unqualified name for a class. IOW, what if someone has a lot of installed plug-ins? You don't want name resolution issues...

                                        Thanks, Greg. I should maybe learn a bit more Ruby. How does this work?

                                        You click VisMap on your Plugins menu. That's a trivial program that loads ...Plugins\vismap\vismap.rb. How might VisMap stumble onto some other Model class, or some other plugin stumble onto my Model?

                                        Thanks!

                                        Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                                        1 Reply Last reply Reply Quote 0
                                        • M Offline
                                          MartinRinehart
                                          last edited by

                                          @edson said:

                                          i followed your instructions. see the attached file below for the result.

                                          That output is perfect. Start to finish, it pulls the data it needs from your model into a correct JavaScript callback. The message doesn't get to JavaScript.

                                          On the PC, this is what I dubbed, The Bug from Hell:

                                          Link Preview Image
                                          I Love JavaScript (Sometimes)

                                          News: From Business Week Big Blue's Global Labs Building a global chain of "collaboratories." Good luck, IBM. May I loan you my copy of Fu...

                                          favicon

                                          (21st-century-languages.blogspot.com)

                                          Just to be sure, there is debugging info commented out in the "rubyReturned" function in "vismap.js". (A JavaScript inline comment is two forward slashes ("//") followed by a comment, or code you don't want to run or a seafood recipe.) Try uncommenting the "// whats_in_model()" function call. Just delete the two slashes. Try Vismap again.

                                          Expected result: nothing. Ruby's callback doesn't call back. Took a week to figure this out on the PC. Why should the Mac be different? (It should be different because it's a Mac, but this is Google code, not Apple code.)

                                          Possible result: you get a pop-up, center screen, detailing "whats_in_model()". Then we have something to work with. Otherwise, ...

                                          Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                                          1 Reply Last reply Reply Quote 0
                                          • M Offline
                                            MartinRinehart
                                            last edited by

                                            The current version now supports about 12k layer/scene intersections.

                                            Mac issues remain.

                                            "Monty", (I say to my pet python) "That's the dumbest idea you've ever had."

                                            "Yeah, hotshot, you got a better idea?"

                                            Lacking an answer, am now trying Monty's suggestion. You never know.

                                            Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 2 / 7
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement