class SectionPlane

 

Parent: DrawingElement

Class Index

Methods: get_plane, set_plane

 

Sample Code:

 

 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.
 

Instance Methods

get_plane

The get_plane method is used to retrieve the plane that the section plane is on.

Syntax:

plane = sectionplane.getplane

Arguments:

 

Return Value:

plane = a plane. See the Geom interface for further information on planes.

Comments:

 

Example:

model = Sketchup.active_model
entities = model.active_entities
sp = entities[1]
plane = sp.get_plane
if (plane)
   UI.messagebox plane
else
   UI.messagebox "Failure"
end


 

set_plane

The set_plane method is used to set the plane that the section plane is on.

Syntax:

sectionplane = sectionplane.set_plane plane

Arguments:

plane - a plane. See the Geom interface for further information on planes.

Return Value:

sectionplane - the SectionPlane object.

Comments:

 

Example:

newplane = [Geom::Point3d.new(-10, 0 ,0), Geom::Vector3d.new(1,0,0)]
model = Sketchup.active_model
entities = model.active_entities
sp = entities[1]
plane = sp.get_plane
if (plane)
   UI.messagebox plane
else
   UI.messagebox "Failure"
end
plane = sp.set_plane newplane
if (plane)
   UI.messagebox plane
else
   UI.messagebox "Failure"