123456789_123456789_123456789_123456789_123456789_

Class: Sketchup::SectionPlane

Relationships
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Sketchup::Drawingelement

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 Attribute Summary

Drawingelement - Inherited

#casts_shadows=

The casts_shadows= method is used to set the Drawingelement to cast shadows.

#casts_shadows?

The casts_shadows? method is used to determine if the Drawingelement is casting shadows.

#hidden=

The hidden= method is used to set the hidden status for an element.

#hidden?

The hidden? method is used to determine if the element is hidden.

#layer

The layer method is used to retrieve the Layer object of the drawing element.

#layer=

The layer= method is used to set the layer for the drawing element.

#material

The material method is used to retrieve the material for the drawing element.

#material=

The material= method is used to set the material for the drawing element.

#receives_shadows=

The receive_shadows= method is used to set the Drawingelement to receive shadows.

#receives_shadows?

The receive_shadows? method is used to determine if the Drawingelement is receiving shadows.

#visible=

The visible= method is used to set the visible status for an element.

#visible?

The visible? method is used to get the visible status for an element.

Entity - Inherited

#deleted?

The deleted? method is used to determine if your entity is still valid (not deleted by another script, for example.).

#valid?

The #valid? method is used to determine if your entity is still valid (not deleted by another script, for example).

Instance Method Summary

Drawingelement - Inherited

#bounds

The #bounds method is used to retrieve the ::Geom::BoundingBox bounding a Drawingelement.

#erase!

The #erase! method is used to erase an element from the model.

Entity - Inherited

#add_observer

The add_observer method is used to add an observer to the current object.

#attribute_dictionaries

The attribute_dictionaries method is used to retrieve the AttributeDictionaries collection attached to the entity.

#attribute_dictionary

The attribute_dictionary method is used to retrieve an attribute dictionary with a given name that is attached to an Entity.

#delete_attribute

The #delete_attribute method is used to delete an attribute from an entity.

#entityID

The entityID method is used to retrieve a unique ID assigned to an entity.

#get_attribute

The #get_attribute method is used to retrieve the value of an attribute in the entity’s attribute dictionary.

#inspect

The #inspect method is used to retrieve the string representation of the entity.

#model

The model method is used to retrieve the model for the entity.

#parent

The parent method is used to retrieve the parent of the entity.

#persistent_id

The #persistent_id method is used to retrieve a unique persistent id assigned to an entity.

#remove_observer

The remove_observer method is used to remove an observer from the current object.

#set_attribute

The set attribute is used to set the value of an attribute in an attribute dictionary with the given name.

#to_s

The #to_s method is used to retrieve the string representation of the entity.

#typename

The typename method retrieves the type of the entity, which will be a string such as “Face”, “Edge”, or “Group”.

Instance Attribute Details

#active?Boolean (readonly)

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

#nameString (rw)

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

Version:

  • SketchUp 2018

#name=(name) (rw)

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

#symbolString (rw)

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

Version:

  • SketchUp 2018

#symbol=(symbol) (rw)

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

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

#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

#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