Active section plane
-
Is there a way in Ruby to determine which of multiple section places are active?
-
Hi Al,
Nope.
There's almost nothing usable with Section Planes. In the help pages they say: "Note that there is no way to get a SectionPlane object using Ruby. You must manually create a section plane with the Section Plane Tool in SketchUp and then query the entities array to find the SectionPlane object".
If you can't even get section plane objects , you also can't say which one is active -
My script - SectionCutFace.rb - which adds faces to selected section plane cuts makes about as much use as you can through Ruby. You can check if what you've selected is a SectionPlane [if ss[0].typename=="SectionPlane"...] and then get its plane [section_plane=ss[0]; plane=section_plane.get_plane] that's about it...
-
Thanks for the help.
We were able to extract section planes in the main drawing. However we just treat them all as active (or none - based on a user option). And we ignore all section planes in groups or components.
-
@didier bur said:
Hi Al,
In the help pages they say: "Note that there is no way to get a SectionPlane object using Ruby. You must manually create a section plane with the Section Plane Tool in SketchUp and then query the entities array to find the SectionPlane object".It looks like I can create a component containing just a section plane, place the component and explode it to place a section plane in a drawing using Ruby.
I need to play with this some more to make sure it works.
(I created the component with a face and a section plane, and then removed the face)
-
Al
Your interesting idea could apply to Section Planes and Dimensions etc that can't (currently) be made wholly inside Ruby, BUT which can be called in via a pre-made Component containing the item you want and then exploded. However you might need to add some actual geometry to the compo and erase it early on so as to leave the section plane behind ? I expect there'll be some BugSplatting before you get it up and running !!!
-
Thanks TIG - I did add geometry to the component before I made it and then removed it by editing.
If I do have problems, I will try removing the geometry after i place the dummy component. Or else I can simply hide a small piece of geometry.
-
I dis-like that you must select a section plane by clicking on it becuse if you ahve a large model and are in close you have no way of determining whether or not you have the section plane selected. Often I must zoom out completely until i can see the grip arrows on the section plane in order to visually verify that the section plane I want is in fact selected. For instance you might have two section planes only 6 inches apart from each other and it's difficult to actually select which one you are selecting from a far back distance.
Advertisement