Spot Elevation Markers Plugin - Dev Help/Review
-
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 -
@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
Advertisement