My favorites | English | Sign in

Faster apps faster - GWT 2.0 with Speed Tracer New!

Google SketchUp Ruby API

SectionPlane

class

Introduction

SketchUp 6.0+

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.

One workaround that does work: you could create a SketchUp model that contains nothing but a SectionPlane, then import that as a component into whatever model you wish to add a SectionPlane to.

Methods

SectionPlane.get_planeSketchUp 6.0+

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

Returns:

plane
a plane. See the Geom module and Array class for further information on planes.
 model = Sketchup.active_model
 entities = model.active_entities
 sp = nil
 # This is to make sure we grab a section plane from the model.
 entities.each do |ent| 
   if ent.typename == "SectionPlane"
     sp = ent
   end
 end
 plane = sp.get_plane
 if (plane)
   UI.messagebox plane
 else
   UI.messagebox "Failure"
 end

SectionPlane.set_planeSketchUp 6.0+

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

Arguments:

plane
An array representing the new plane,

Returns:

section_plane
the updated SectionPlane.
 model = Sketchup.active_model
 entities = model.active_entities
 sp = nil
 # This is to make sure we grab a section plane from the model.
 entities.each do |ent| 
   if ent.typename == "SectionPlane"
     sp = ent
   end
 end
 sp = sp.set_plane my_plane_array