sketchucation logo sketchucation
    • Anmelden
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    ⚠️ Important | Libfredo 15.6b introduces important bugfixes for Fredo's Extensions Update

    Spot Elevation Markers Plugin - Dev Help/Review

    Geplant Angeheftet Gesperrt Verschoben Developers' Forum
    21 Beiträge 8 Kommentatoren 3.5k Aufrufe 8 Watching
    Lade mehr Beiträge
    • Älteste zuerst
    • Neuste zuerst
    • Meiste Stimmen
    Antworten
    • In einem neuen Thema antworten
    Anmelden zum Antworten
    Dieses Thema wurde gelöscht. Nur Nutzer mit entsprechenden Rechten können es sehen.
    • M Offline
      matt.gordon320
      zuletzt editiert von

      @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 Antwort Letzte Antwort Antworten Zitieren 0
      • Dan RathbunD Offline
        Dan Rathbun
        zuletzt editiert von

        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 Antwort Letzte Antwort Antworten Zitieren 0
        • M Offline
          matt.gordon320
          zuletzt editiert von

          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 Antwort Letzte Antwort Antworten Zitieren 0
          • Dan RathbunD Offline
            Dan Rathbun
            zuletzt editiert von

            @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 Antwort Letzte Antwort Antworten Zitieren 0
            • thomthomT Offline
              thomthom
              zuletzt editiert von

              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 Antwort Letzte Antwort Antworten Zitieren 0
              • M Offline
                matt.gordon320
                zuletzt editiert von

                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 Antwort Letzte Antwort Antworten Zitieren 0
                • O Offline
                  oslocadiz
                  zuletzt editiert von

                  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 Antwort Letzte Antwort Antworten Zitieren 0
                  • mitcorbM Offline
                    mitcorb
                    zuletzt editiert von

                    @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 Antwort Letzte Antwort Antworten Zitieren 0
                    • O Offline
                      oslocadiz
                      zuletzt editiert von

                      @mitcorb
                      Thank you very much for the advice 😄

                      1 Antwort Letzte Antwort Antworten Zitieren 0
                      • M Offline
                        matt.gordon320
                        zuletzt editiert von

                        @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 Antwort Letzte Antwort Antworten Zitieren 0
                        • 1
                        • 2
                        • 1 / 2
                        • Erster Beitrag
                          Letzter Beitrag
                        Buy SketchPlus
                        Buy SUbD
                        Buy WrapR
                        Buy eBook
                        Buy Modelur
                        Buy Vertex Tools
                        Buy SketchCuisine
                        Buy FormFonts

                        Advertisement