Class: Sketchup::SectionPlane

Inherits:
Drawingelement show all

Overview

The SectionPlane class represents a section plane in a SketchUp model. Note that prior to SketchUp 2014 there was no way to create a SectionPlane object using Ruby. For older versions of SketchUp, 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.

Version:

  • SketchUp 6.0

Instance Method Summary # collapse

Methods inherited from Drawingelement

#bounds, #casts_shadows=, #casts_shadows?, #erase!, #hidden=, #hidden?, #layer, #layer=, #material, #material=, #receives_shadows=, #receives_shadows?, #visible=, #visible?

Methods inherited from Entity

#add_observer, #attribute_dictionaries, #attribute_dictionary, #delete_attribute, #deleted?, #entityID, #get_attribute, #inspect, #model, #parent, #persistent_id, #remove_observer, #set_attribute, #to_s, #typename, #valid?

Instance Method Details

#activateObject

The activate method is used to make the section plane the active one of its parent component/group.

Examples:

entities = Sketchup.active_model.entities
sp = entities.add_section_plane([50, 50, 0], [1.0, 1.0, 0])
sp.activate

Returns:

  • self if successful

Version:

  • SketchUp 2014

#active?Boolean

The active? method indicates whether the section plane is active or not.

Examples:

entities = Sketchup.active_model.entities
sp = entities.add_section_plane([50, 50, 0], [1.0, 1.0, 0])
sp.activate
if sp.active?
   puts "Yes, it is active"
end

Returns:

  • (Boolean)

    boolean - true if active

Version:

  • SketchUp 2014

#get_planeObject

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

Examples:

model = Sketchup.active_model
entities = model.active_entities
# Grab the first section plane from the model.
sp = entities.grep(Sketchup::SectionPlane).first
plane = sp.get_plane
if (plane)
  puts plane.to_s
else
  puts 'Failure'
end

Returns:

  • plane - a plane. See the Geom module and Array class for further information on planes.

Version:

  • SketchUp 6.0

#nameString

The #name method is used to retrieve the name of the section plane.

Examples:

model = Sketchup.active_model
entities = model.active_entities
# Grab the first section plane from the model.
section_plane = entities.grep(Sketchup::SectionPlane).first
name = section_plane.name

Returns:

Version:

  • SketchUp 2018

#name=(name) ⇒ Object

The #name= method is used to set the name of a section plane.

Examples:

model = Sketchup.active_model
entities = Sketchup.active_model.entities
# Grab the first section plane from the model.
section_plane = entities.grep(Sketchup::SectionPlane).first
section_plane.name = "my section plane"

Parameters:

  • name (String)

    The new name for the section plane object.

Version:

  • SketchUp 2018

#set_plane(plane) ⇒ Object

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

Examples:

model = Sketchup.active_model
entities = model.active_entities
# Grab the first section plane from the model.
sp = entities.grep(Sketchup::SectionPlane).first
sp = sp.set_plane my_plane_array

Parameters:

  • plane

    An array representing the new plane,

Returns:

  • section_plane - the updated SectionPlane.

Version:

  • SketchUp 6.0

#symbolString

The #symbol method is used to retrieve the symbol of the section plane.

Examples:

model = Sketchup.active_model
entities = model.active_entities
# Grab the first section plane from the model.
section_plane = entities.grep(Sketchup::SectionPlane).first
symbol = section_plane.symbol

Returns:

Version:

  • SketchUp 2018

#symbol=(symbol) ⇒ Object

Note:

The symbol must be three characters or less.

The #symbol= method is used to set the symbol of a section plane.

Examples:

model = Sketchup.active_model
entities = Sketchup.active_model.entities
# Grab the first section plane from the model.
section_plane = entities.grep(Sketchup::SectionPlane).first
section_plane.symbol = "AB1"

Parameters:

  • symbol (String)

    The new symbol for the section plane object.

Version:

  • SketchUp 2018