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.
The direction method retrieves a 3D vector in the direction of the construction line.
Returns:
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.to_s else UI.messagebox "Failure" end
The direction= method is used to set the direction of the construction line to a 3D vector.
Arguments:
Returns:
# 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
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.
Returns:
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
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.
Arguments:
Returns:
# Need better examples throughout this file. 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 endofline = constline.end = nil if (endofline) UI.messagebox endofline.to_s else UI.messagebox endofline.to_s end
The position method is used to retrieve a 3D point used to create a construction line on an infinite construction line.
Returns:
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
The position= method is used to set a 3D point that the construction passes through
Arguments:
Returns:
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
The reverse! method is used to reverse the direction of the construction line.
Returns:
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!
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.
Returns:
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
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.
Arguments:
Returns:
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
The stipple method is used to retrieve the stipple pattern used to display the construction line.
Returns:
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
The stipple= method is used to set the stipple pattern used to display the construction line. The stipple pattern can be given as a string or as a number. Valid strings are: ".", "-", "_", "-.-".
Arguments:
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 = "-.-"