SketchUp  Ruby API Reference 

Class Index

Method Index

Developers Guide

Examples

SectionPlane class

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

Methods:get_plane, set_plane

Example Code: sectionplanetests.rb

Instance Methods


get_plane 

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

Syntax

plane = sectionplane.getplane

Return Value

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

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.

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"

 

SketchUp  Ruby API Reference: SectionPlane

© Google Inc. 2007 sketchup.google.com