|
SketchUp Ruby API Reference |
The SectionPlane class contains methods to get and set the plane for the SectionPlane in a model. 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. This class was primarily added for compatibility with a third-party software product.
Parent:DrawingElement
Example Code: sectionplanetests.rb
The get_plane method is used to retrieve the plane that the section plane is on.
plane = sectionplane.getplane
plane = a plane. See the Geom interface for further information on planes.
model = Sketchup.active_modelentities = model.active_entitiessp = entities[1]plane = sp.get_planeif (plane)UI.messagebox planeelseUI.messagebox "Failure"end
The set_plane method is used to set the plane that the section plane is on.
sectionplane = sectionplane.set_plane plane
plane - a plane. See the Geom interface for further information on planes.
sectionplane - the SectionPlane object.
newplane = [Geom::Point3d.new(-10, 0 ,0), Geom::Vector3d.new(1,0,0)]model = Sketchup.active_modelentities = model.active_entitiessp = entities[1]plane = sp.get_planeif (plane)UI.messagebox planeelseUI.messagebox "Failure"endplane = sp.set_plane newplaneif (plane)UI.messagebox planeelseUI.messagebox "Failure"
|
SketchUp Ruby API Reference: SectionPlane |
© Google Inc. 2007 sketchup.google.com |