M:
Do you need the angle in plan (projected down to the ground plane)? Also, be aware that the angle_between method will not return a negative value. It's always the absolute value of the difference, and it is that angle in 3D (not in plan). CB.
M:
Do you need the angle in plan (projected down to the ground plane)? Also, be aware that the angle_between method will not return a negative value. It's always the absolute value of the difference, and it is that angle in 3D (not in plan). CB.
Can I change the font size used for dimension lines from within a ruby script? Thanks, CB.
Todd: Thanks for the tip, and sorry for assuming that what I found at smustard would be Rick's. I use Dashed lines all the time. Thanks for that, too. CB.
That worked great for me, guys. Thanks a lot. Rick, I found a good example in your dashed lines script. I noticed that you had dropdowns in your inputbox, and figured out how you did it (not documented in the SU Ruby docs?). I have several Y/N options, but I could only get one drop-down box to work on a given inputbox. Is that a known limitation, or am I doing something wrong? CB.
I See. I assume you are referring to read_defaults and write_defaults? Does this work across platforms? I don't see where you specify the file name, so it must use a central database that the whole sketchup application uses? Thanks, Rick - I'll experiment. CB.
I'd like users of my script to be able to set some parameters that affect the behavior of the script, and I'd like those to be saved across sessions. What's the best way to accomplish that? Can you manipulate the registry from within a ruby script? (Windows specific, anyway, so not the best option). A pointer to an example script would be fine. Thanks, CB.
TIG:
Unfortunately, that won't work for all cases. Here's another example.
The result I want in this case is 10" x 10" x about 11'. But this one does not have a "horizontal" face. The "bottom" face has bounds of ~7' x ~7'. I know how to "lay it down". But I think the next step is to recursively explode it, and then un-explode it again and take the bounds of the new object. But I have no idea how to un-explode.
This all works perfectly if I do it manually, but how to do it from ruby?
Seems like I've been here before... CB.
http://www.sketchucation.com/forums/scf/sas/Ruby/rafter_example.skp
Haggai:
That's great - that's just what I want. I see how you did that with your mouse, but how do I do it from within a ruby script?
TIG:
It's not really a rectangular solid. In the shop, I cut it from a rectangular solid (a really big piece of timber). I'm working on a ruby to give me the materials list. I need to know what size timber I need to cut something like this. So there may be more faces than just the 6 standard faces of the rectangular solid. I won't know in advance how many, or which face is which.
Thanks for your help guys. CB.
I need to determine the width, depth, and length of a rectangular solid. Of course, one would just use the bounding box, and this works for me in some instances, but in others, there are sub components that are contained within the parent, but are set at an angle relative to the parent, and whose bounding box thus protrudes outside the rectangular bounds I'm really looking for. See the example. I think the solution is to make a copy, explode it all, then place all the pieces back together as one group, then take it's bounding box, then delete it. Anyone think that will work? Is there a way to put all the pieces into a group? CB.
http://www.sketchucation.com/forums/scf/sas/Ruby/collar%20example.skp
This is brilliant! How many times have I carefully selected a whole mess of objects one at a time, only to click the wrong thing and lose the selection? This really saves time and aggrevation. Well done, Rick. CB.
Thanks, DB, that helps a lot.
I just changed my code to try using the angle_between angle, and then check the result to see if it's where I expect it to be. If not, then I reverse the angle, and try again. Lots of code, but correct behavior now! Thanks again. CB.
I'm trying to rotate a comp inst so that it is parallel to the green axis. I have a vector that represents the component, and I use that vector's angle_between method to create a (rotation) transformation object to apply to my comp inst. It works right most of the time, but sometimes, it rotates in the wrong direction. It seems that angle_between never returns a negative value, even if I want to rotate in a "backwards" direction. Is there a better way to find the angle? Thanks, CB.
I've got a situation where I manipulate comp instances through a series of transforms. There are several sub-comps within a parent comp. When all the dust settles, my new creation appears on the screen, and it looks correct. The script then opens the save dialog, and the user saves the file. If I then come back and open the saved file, it does not match what was on the screen when I saved it! Some of the sub-components have undergone some strange transforms, and appear flipped and located on the opposite side of the parent comp. Anybody seen anything like this? This doesn't happen every time, only with certain sitiations. But it's absolutely repeatable. CB.
Present
Clark Bremer - aka daiku
Owner - Northern Lights Timber Framing
(previously: DMTS - Lucent Bell Labs)