123456789_123456789_123456789_123456789_123456789_

Class: Sketchup::ConstructionLine

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

Overview

The ConstructionLine class contains methods for modifying construction lines. Construction lines can be infinite in length, semi-infinite (i.e. infinite in one direction) or finite.

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

#directionObject (rw)

The direction method retrieves a 3D vector in the direction of the construction line.

Examples:

model = Sketchup.active_model
entities = model.active_entities
point1 = Geom::Point3d.new(0,0,0)
point2 = Geom::Point3d.new(20,20,20)
constline = entities.add_cline(point1, point2)
vector = constline.direction
if (vector)
  UI.messagebox(vector)
else
  UI.messagebox("Failure")
end

Returns:

  • vector - a Vector3d object if successful

Version:

  • SketchUp 6.0

#direction=(vector) ⇒ Object (rw)

The direction= method is used to set the direction of the construction line to a 3D vector.

Examples:

# Draw a construction line that points diagonally.
model = Sketchup.active_model
entities = model.active_entities
constline = entities.add_cline([10,10,10], [200,200,200])

# Create a new direction that is straight up, and redirect the line.
new_direction = [0, 0, 1]
constline.direction = new_direction

Parameters:

  • vector

    The Vector3d whose direction will be used to set the direction of the construction line.

Returns:

  • vector - the new Vector3d object if successful

Version:

  • SketchUp 6.0

#endObject (rw)

The end method retrieves the end point of a construction line in the form of a 3D point.

If the construction line is infinite at the end, this returns nil.

Examples:

model = Sketchup.active_model
entities = model.active_entities
point1 = Geom::Point3d.new(0,0,0)
point2 = Geom::Point3d.new(20,20,20)
constline = entities.add_cline(point1, point2)
endofline = constline.end

Returns:

  • point - a Point3d object representing the end of the construction line

Version:

  • SketchUp 6.0

#end=(point) ⇒ Object (rw) #end=(nil) ⇒ Object

The end= method is used to set the end point of the construction line. This method will make the length finite at the end.

Set the end to nil to make the construction line infinite at the end.

Examples:

model = Sketchup.active_model
entities = model.active_entities
point1 = Geom::Point3d.new(0,0,0)
point2 = Geom::Point3d.new(20,20,20)
point3 = Geom::Point3d.new(10,10,10)
constline = entities.add_cline(point1, point2)
UI.messagebox(constline.end)
# Will display point2

Overloads:

  • #end=(point) ⇒ Object

    Parameters:

    • point (Geom::Point3d)

      The Point3d object to set for the end point of the construction line.

    Returns:

    • point - a Point3d object if successful or nil

  • #end=(nil) ⇒ Object

    Parameters:

    • nil (nil)

      Sets the end point to infinite.

    Returns:

    • point - a Point3d object if successful or nil

Version:

  • SketchUp 6.0

#positionObject (rw)

The position method is used to retrieve a 3D point used to create a construction line on an infinite construction line.

Examples:

model = Sketchup.active_model
entities = model.active_entities
point1 = Geom::Point3d.new(0,0,0)
vector = Geom::Vector3d.new(10,10,10)
constline = entities.add_cline(point1, vector)
# Returns point1 or 0,0,0
position = constline.position

Returns:

  • point - the Point3d object used to create the line (if successful)

Version:

  • SketchUp 6.0

#position=(point) ⇒ Object (rw)

The position= method is used to set a 3D point that the construction passes through

Examples:

model = Sketchup.active_model
entities = model.active_entities
point1 = Geom::Point3d.new(0,0,0)
point2 = Geom::Point3d.new(20,20,20)
point3 = Geom::Point3d.new(0,20,20)
constline = entities.add_cline(point1, point2)
position = constline.position = point3

Parameters:

  • point

    The Point3d object for the construction line to pass through.

Returns:

  • point - the new Point3d object that the construction line will pass through (if successful)

Version:

  • SketchUp 6.0

#startObject (rw)

The start method is used to retrieve the starting point of a construction line.

If the construction line is infinite at the start, this returns nil.

Examples:

model = Sketchup.active_model
entities = model.active_entities
point1 = Geom::Point3d.new(0,0,0)
point2 = Geom::Point3d.new(20,20,20)
constline = entities.add_cline(point1, point2)
startofline = constline.start

Returns:

  • point - the Poin3d object representing the starting point of the construction line (if successful)

Version:

  • SketchUp 6.0

#start=(point) ⇒ Object (rw) #start=(nil) ⇒ Object

The start= method is used to set the start point of a construction line making the line’s length finite at the start.

Setting the start to nil will make the construction line infinite at the start.

Examples:

model = Sketchup.active_model
entities = model.active_entities
point1 = Geom::Point3d.new(0,0,0)
point2 = Geom::Point3d.new(20,20,20)
point3 = Geom::Point3d.new(5,5,5)
constline = entities.add_cline(point1, point2)
startofline = constline.start = point3

Overloads:

  • #start=(point) ⇒ Object

    Parameters:

    • point (Geom::Point3d)

      The Point3d object to set for the start point of the construction line.

    Returns:

    • point - a Point3d object if successful or nil

  • #start=(nil) ⇒ Object

    Parameters:

    • nil (nil)

      Sets the start point to infinite.

    Returns:

    • point - a Point3d object if successful or nil

Version:

  • SketchUp 6.0

#stippleString (rw)

The #stipple method is used to retrieve the stipple pattern used to display the construction line.

Examples:

model = Sketchup.active_model
entities = model.active_entities
point1 = Geom::Point3d.new(0, 0, 0)
point2 = Geom::Point3d.new(20, 20, 20)
constline = entities.add_cline(point1, point2)
puts constline.stipple

Version:

  • SketchUp 6.0

#stipple=(pattern) (rw)

The #stipple= method is used to set the stipple pattern used to display the construction line. The stipple pattern is given as a string.

Valid strings are:

  • "." (Dotted Line),

  • "-" (Short Dashes Line),

  • "_" (Long Dashes Line),

  • "-.-" (Dash Dot Dash Line).

Examples:

model = Sketchup.active_model
entities = model.active_entities
point1 = Geom::Point3d.new(0, 0, 0)
point2 = Geom::Point3d.new(20, 20, 20)
constline = entities.add_cline(point1, point2)
constline.stipple = "-.-"

Parameters:

Version:

  • SketchUp 6.0

Instance Method Details

#reverse!Object

The reverse! method is used to reverse the direction of the construction line.

Examples:

model = Sketchup.active_model
entities = model.active_entities
point1 = Geom::Point3d.new(0,0,0)
point2 = Geom::Point3d.new(20,20,20)
constline = entities.add_cline(point1, point2)
status = constline.reverse!

Returns:

  • status

Version:

  • SketchUp 6.0