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

    Spot Elevation Markers Plugin - Dev Help/Review

    Scheduled Pinned Locked Moved Developers' Forum
    21 Posts 8 Posters 3.2k Views 8 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.
    • Dan RathbunD Offline
      Dan Rathbun
      last edited by

      FYI we have discussed in the past the Feature Request of adding Datum Dimensioning into SketchUp... as well as the issue that NONE of the dimension features of SketchUp are exposed by the Ruby API.

      The Marker would be similar to the native Sketchup::Text leader objects (callouts) which are also lacking some extended API features, such as specifying dynamic replaceable parameters for the leader text. Ex: If you attach a callout to a point, it shows all 3 (x, y, z) values in model units. BUT .. when moved the text does not appear to get automatically updated.

      So IMHO your plugin would be much easier.. if some of the issues with the API that we have already logged, were to be fixed.

      Display: No problem there if you put the markers on a spacial layer. Toggle that layer to control display.

      I'm not here much anymore.

      1 Reply Last reply Reply Quote 0
      • M Offline
        matt.gordon320
        last edited by

        @dan rathbun said:

        So IMHO your plugin would be much easier.. if some of the issues with the API that we have already logged, were to be fixed.

        Hi Dan! Thanks for your input. Let me ask you this based on your knowledge of the API. Do you think this is a decent project to move forward with given the lack of extended documentation in the API and my relative lack of experience? Or would you recommend a different project (perhaps a simpler script), at least until the API is updated?

        As I've said before, I'm all up for a challenge, but giving myself an insurmountably difficult task due to lacking API references sounds more like and exercise in frustration.

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

          Well in my "Newbie's Guide" I always suggest starting with a simple project first, learn the basics, and move on to more complex projects, step by step.

          Now another possibilty to work around the issues in the current API, may be to create your OWN dynamic component elevation callouts.
          These may only need the very basics of a plugin (menu items or toolbar buttons to insert them.)

          So first task, learn in "goodies" of Dynamic Components. You can have Text objects nested inside a DC.
          Part of the plugin code, could search for all DC named "ElevationMarker" and modify the text of their nested Text object to the current z value. (If you cannot get the DC to do it automatically.)

          Check the DC forum.

          I'm not here much anymore.

          1 Reply Last reply Reply Quote 0
          • M Offline
            matt.gordon320
            last edited by

            Thanks Dan! I've been fiddling with DC's for a little bit, and I see what you mean. Already I can get a DC that will update it's Z-height when moved. The next bit will be, as you said, searching and updating all the text within each marker. Thanks for the kick start...I'm sure I'll have more questions 😄

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

              @matt.gordon320 said:

              Thanks Dan! I've been fiddling with DC's for a little bit, and I see what you mean. Already I can get a DC that will update it's Z-height when moved.

              The next bit will be, as you said, searching and updating all the text within each marker.

              The fastest way to get a collection of a CERTAIN component's instances, is to go through the model's DefintionList collection, rather than iterate through the model's Entities collection, which can be anything, ... primitives, groups, etc.

              compname = 'ElevationMarker'
              model = Sketchup.active_model
              list = model.definitions
              found = list.find {|d| d.name == compname }
              # found will be nil (& eval as false) if not found
              if found
                found.instances.each {|i|
                  # update the instance i here
                }
              else
                # do something else here, if needed
              end
              

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                thomthom
                last edited by

                Ah! I've gotten all about this thread! (Just adding a comment now to ensure it appear on my list of threads I participate in.)

                Thomas Thomassen — SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • M Offline
                  matt.gordon320
                  last edited by

                  Hey guys,

                  Thanks for all the help so far. I'm going through and writing out a series of steps I need to take, so as to get the basics down first and not bite off more than I can chew (at least not more than I have already) 😆 So I've got this question for you. Would it be faster and smarter performance-wise to create the Spot Elevation Marker Component "on the fly" as it were, in the script itself, or to include a folder with the script and have it simply import pre-made Spot Elevation Marker Components?

                  I figure the latter might be nice because, theoretically, I could add different types of markers in the future without having to constantly re-vamp the code every time. I don't know if this is a smart way to go though, as I don't know enough yet 😳

                  Thanks!

                  PS - Any refernces you guys have as to the Dynamic Components API? I haven't really found a lot yet on adding DC functionality through ruby, but then I probably haven't searched enough yet. I'll likely find it as soon as I submit this comment.

                  1 Reply Last reply Reply Quote 0
                  • O Offline
                    oslocadiz
                    last edited by

                    Hi anyone,

                    I'm having problems installing the Spot Elevation Marker plugin. Could you please give me a little explanation where you have to place the plugin or how to install it?

                    Thank you in advance

                    1 Reply Last reply Reply Quote 0
                    • mitcorbM Offline
                      mitcorb
                      last edited by

                      @oslocadiz:
                      As far as I can tell, this script is not ready for distribution. You might contact the author.

                      Another possibility would be one of TIG's tools with "Datum" as a keyword.

                      I take the slow, deliberate approach in my aimless wandering.

                      1 Reply Last reply Reply Quote 0
                      • O Offline
                        oslocadiz
                        last edited by

                        @mitcorb
                        Thank you very much for the advice 😄

                        1 Reply Last reply Reply Quote 0
                        • M Offline
                          matt.gordon320
                          last edited by

                          @mitcorb oslocadiz is correct, the script is not at a point where it's useful in any way. I'm just in the first stages of learning Ruby, so this post was more as a way of asking the skilled developers in the forum for advice and feedback, not as a usable script at this point.

                          Furthermore, TIG's produced (as usual) a very capable script that does Datum measurements, I'd recommend that. I may shelf this project for the time being anyway, as it's a little to ambitious for my knowledge at the moment. I wish I knew more, but I just haven't had the time to devote to it enough, or enough understanding at this point.

                          Thanks for the interest,

                          Matt

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

                          Advertisement