Spot Elevation Markers Plugin - Dev Help/Review
-
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.
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
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!
-
Hi Matt,
Your project page says "There's nothing to see yet..." -
Hmm, alright then, looks like I have some investigating to do.
-
Ok gents, I forgot to publish the branch. It should be good to view now. Thanks!
-
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 -
@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
erkanHi 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.
-
GB_Spot_Elev.rb in missing an end statement for the unless statement.
-
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 -
@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.
-
@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,
erkanHi 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:
- 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
-
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.
-
@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.
-
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.
-
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
-
@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'sEntities
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
-
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.)
-
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.
-
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
-
@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.
-
@mitcorb
Thank you very much for the advice
Advertisement