sketchucation logo sketchucation
    • 登入
    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!
    🔌 Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download

    Spot Elevation Markers Plugin - Dev Help/Review

    已排程 已置頂 已鎖定 已移動 Developers' Forum
    21 貼文 8 Posters 3.7k 瀏覽 8 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • M 離線
      matt.gordon320
      最後由 matt.gordon320 編輯

      THIS PLUGIN IS NOT READY FOR DISTRIBUTION OR USE. THIS POST IS FOR ADVICE FROM DEVELOPERS

      Hello Developer Gurus,

      I've been a SketchUp user for probably 7 years now, but I'm finally trying to get into learning Ruby. I've been digging in and learning as much as I can from various resources (Lynda.com, The Pragmatic Programmer, Codecademy, Code School, etc.), but I figure that the best way there is for me to learn is the hard way: jumping in and writing (and re-writing * 1000).

      So, that being said, I'd love to have you guys tear into my project and tell me what you think. Thus far, it's only at the conceptual & planning stage. I know it'll be a long road, but I really want to learn what I'm doing, and I figured this would be a great resource. I'll openly admit I don't know much 😳 , so whatever you gents would have to say is welcome (related to the ruby code itself, good practices, Git stuff, or anything else you feel I need to know).

      I've included a link to my GitHub project page, so you're welcome to have at it! It's currently not so great, but hopefully with some time, it'll get there.

      Link Preview Image
      GitHub - mattgordon320/Spot-Elevation-Marker: Tools for creating Spot Elevation Markers (single or multiple) inside SketchUp

      Tools for creating Spot Elevation Markers (single or multiple) inside SketchUp - mattgordon320/Spot-Elevation-Marker

      favicon

      GitHub (github.com)

      Just to make it clear, this plugin is not ready for use. It's only in the early planning stages. My request is that Devs have a look and give whatever helpful feedback they see fit. It's FAR from being functional.

      Thanks Guys!

      1 條回覆 最後回覆 回覆 引用 0
      • Didier BurD 離線
        Didier Bur
        最後由 編輯

        Hi Matt,
        Your project page says "There's nothing to see yet..."

        DB

        1 條回覆 最後回覆 回覆 引用 0
        • M 離線
          matt.gordon320
          最後由 編輯

          Hmm, alright then, looks like I have some investigating to do.

          1 條回覆 最後回覆 回覆 引用 0
          • M 離線
            matt.gordon320
            最後由 編輯

            Ok gents, I forgot to publish the branch. It should be good to view now. Thanks!

            1 條回覆 最後回覆 回覆 引用 0
            • erkanE 離線
              erkan
              最後由 編輯

              Hi Matt,

              It sounds like a neat idea for a plugin, unfortunately I'm getting the below error on load;
              "Error Loading File GB_Spot_Elev_Loader.rb
              C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/GB_Spot_Elev_Loader.rb:34: syntax error, unexpected kEND, expecting $end"

              cheers
              erkan

              1 條回覆 最後回覆 回覆 引用 0
              • M 離線
                matt.gordon320
                最後由 編輯

                @erkan said:

                Hi Matt,

                It sounds like a neat idea for a plugin, unfortunately I'm getting the below error on load;
                "Error Loading File GB_Spot_Elev_Loader.rb
                C:/Program Files (x86)/Google/Google SketchUp 8/Plugins/GB_Spot_Elev_Loader.rb:34: syntax error, unexpected kEND, expecting $end"

                cheers
                erkan

                Hi Erkan, I went back and updated my description for the plugin. Since I'm extremely new to this, I'm looking more for advice and feedback on the idea and how best to go about writing the plugin than I am testing at the moment. The plugin doesn't work at the moment, and likely won't for a while. I wouldn't recommend loading it or using it in SketchUp yet; it just isn't there yet.

                1 條回覆 最後回覆 回覆 引用 0
                • sdmitchS 離線
                  sdmitch
                  最後由 編輯

                  GB_Spot_Elev.rb in missing an end statement for the unless statement.

                  Nothing is worthless, it can always be used as a bad example.

                  http://sdmitch.blogspot.com/

                  1 條回覆 最後回覆 回覆 引用 0
                  • erkanE 離線
                    erkan
                    最後由 編輯

                    I see, so can you share what your plans are? From the sound of it I can't help dreaming a plugin that will create an object in the SU to dynamically output the difference to the -+0.00 level.

                    Some questions around that would be;
                    1- Do you want to attach this to an object that will be manually placed, moved or to a specific surface (i.e. floor, paving, deck) and it will be automatically updated?
                    2- Styles for the markers to be customizable?
                    3- To be graphically handled differently in elevation and plan view.
                    4- Interaction with the section planes (i.e. how close it could get to a section plane?)
                    5- Match the drawing units or have it's own unit controls (It is quite common to use Meters for elevation markers in a drawing where the other dimensions are millimeters)
                    6- I think it will be wonderful to extend the capability to mark slopes in plan and elevation as well.

                    Whew it looks like you'll have a challenging task starting 😄

                    Good luck,
                    erkan

                    1 條回覆 最後回覆 回覆 引用 0
                    • M 離線
                      matt.gordon320
                      最後由 編輯

                      @sdmitch said:

                      GB_Spot_Elev.rb in missing an end statement for the unless statement.

                      Thanks! I'll make myself a note of that to put in.

                      1 條回覆 最後回覆 回覆 引用 0
                      • M 離線
                        matt.gordon320
                        最後由 編輯

                        @erkan said:

                        I see, so can you share what your plans are? From the sound of it I can't help dreaming a plugin that will create an object in the SU to dynamically output the difference to the -+0.00 level.

                        Some questions around that would be;
                        1- Do you want to attach this to an object that will be manually placed, moved or to a specific surface (i.e. floor, paving, deck) and it will be automatically updated?
                        2- Styles for the markers to be customizable?
                        3- To be graphically handled differently in elevation and plan view.
                        4- Interaction with the section planes (i.e. how close it could get to a section plane?)
                        5- Match the drawing units or have it's own unit controls (It is quite common to use Meters for elevation markers in a drawing where the other dimensions are millimeters)
                        6- I think it will be wonderful to extend the capability to mark slopes in plan and elevation as well.

                        Whew it looks like you'll have a challenging task starting 😄

                        Good luck,
                        erkan

                        Hi Erkan,

                        What you are describing is very much what I hope to achieve (someday). I've included a PDF "plan" of what I would like to do so far. But to answer your specific questions:

                        1. At least in it's first iteration, I'd like the plugin to be able to read the z height of any given point (when clicked on, and create a marker that is dynamically linked to said height. (Ideally keeping track of the height as you modify terrain).1. I would like to build in several graphic styles or options for the markers, as you suggested 1. Different handling of views would be good (IE visible in both elevation, plan, perspective, etc. 1. This one's interesting, I hadn't even thought about the interaction with section planes. I'd love any suggestion you have here. 1. I think the individual or special unit control/readout would be a great idea, as you said. It would be a pain if working in mm to have the markers read in mm for a Master Plan or some such project. 1. Slope marking would be another great addition to the list that I hadn't even thought of.

                        Thanks for the input. I guess my first question for those of you familiar with Ruby is where to begin?

                        I wanted to build a fairly complete road map of the project before starting, so that I can at least try to minimize how much I have to go back and rebuild for new features. That being said, I know that it's going to be a very challenging task. For me though, I usually learn better through bigger challenges.

                        I'm thinking the best place for me to start is to knock out most of my "road map", then start building the individual modules to piece together as I go. The first one I'll probably try to tackle is just the task of creating a Spot Elevation Marker in 1 graphic style wherever I click. That'll probably be a heck of a challenge for now.

                        Again, I'm super new to this, so if there's significant flaws in the logic of this or how I'm going about it, let me know.

                        Thanks again,

                        Matt


                        Spot Elevation Markers Script - Development Map.pdf

                        1 條回覆 最後回覆 回覆 引用 0
                        • Dan RathbunD 離線
                          Dan Rathbun
                          最後由 編輯

                          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 條回覆 最後回覆 回覆 引用 0
                          • M 離線
                            matt.gordon320
                            最後由 編輯

                            @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 條回覆 最後回覆 回覆 引用 0
                            • Dan RathbunD 離線
                              Dan Rathbun
                              最後由 編輯

                              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 條回覆 最後回覆 回覆 引用 0
                              • M 離線
                                matt.gordon320
                                最後由 編輯

                                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 條回覆 最後回覆 回覆 引用 0
                                • Dan RathbunD 離線
                                  Dan Rathbun
                                  最後由 編輯

                                  @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 條回覆 最後回覆 回覆 引用 0
                                  • thomthomT 離線
                                    thomthom
                                    最後由 編輯

                                    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 條回覆 最後回覆 回覆 引用 0
                                    • M 離線
                                      matt.gordon320
                                      最後由 編輯

                                      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 條回覆 最後回覆 回覆 引用 0
                                      • O 離線
                                        oslocadiz
                                        最後由 編輯

                                        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 條回覆 最後回覆 回覆 引用 0
                                        • mitcorbM 離線
                                          mitcorb
                                          最後由 編輯

                                          @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 條回覆 最後回覆 回覆 引用 0
                                          • O 離線
                                            oslocadiz
                                            最後由 編輯

                                            @mitcorb
                                            Thank you very much for the advice 😄

                                            1 條回覆 最後回覆 回覆 引用 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • 第一個貼文
                                              最後的貼文
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement