class Sketchup::Text

The Text class contains method to manipulate a Text entity object.

@version SketchUp 6.0

Public Instance Methods

arrow_type() click to toggle source

The arrow_type method retrieves the current arrow type used for the leader text.

Valid arrow types are 0 for none, 2 for dot, 3 for closed arrow, 4 for open arrow.

@example

type = text.arrow_type=0

@return [Integer] a numerical representation for the type of

arrow.

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 24
def arrow_type
end
arrow_type=(type) click to toggle source

The arrow_type= method sets the arrow type used for leader text.

Valid arrow types are 0 for none, 2 for dot, 3 for closed arrow, 4 for open arrow.

@example

arrow = text.arrow_type=type

@param [Integer] type

A numerical representation of the type of arrow to be
set.

@return [Integer] a numerical representation for the type of

arrow.

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 43
def arrow_type=(type)
end
attached_to() click to toggle source

The {#attached_to} method returns an array of the attached {Sketchup::InstancePath} object and the {Geom::Point3d}.

@example

# Have a text annotation attached to a drawing element and selected
Sketchup.active_model.selection[0].attached_to

@return [Array(Sketchup::InstancePath, Geom::Point3d), nil]

@version SketchUp 2019

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 56
def attached_to
end
attached_to=(path) click to toggle source

The {#attached_to=} method will attach the {Sketchup::Text} to another {Sketchup::DrawingElement}.

@example

# Have a text annotation attached to a drawing element and selected
array = Sketchup.active_model.selection[0].attached_to
Sketchup.active_model.selection[0].attached_to = [array[0], Geom::Point3d.new(0, 0, 0)]

@param [Array(Sketchup::InstancePath, Geom::Point3d)] path

@version SketchUp 2019

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 70
def attached_to=(path)
end
display_leader=(status) click to toggle source

The display_leader= method accepts true or false for whether to display the leader.

Leader text that is not displayed is set to Hidden type.

@example

leader = text.display_leader=true

@param [Boolean] status

true if you want to display the leader text, false if
you do not want to display the leader text.

@return [Boolean] the status that you set.

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 88
def display_leader=(status)
end
display_leader?() click to toggle source

The display_leader? method returns the status of the leader.

@example

status = text.display_leader

@return [Boolean]

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 99
def display_leader?
end
has_leader?() click to toggle source

The has_leader method is used to determine if the Text object has a leader.

@example

status = text.has_leader

@return [Boolean]

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 110
def has_leader?
end
leader_type() click to toggle source

The leader_type method retrieves the currently set leader type.

@example

leader = text.leader_type

@return [Integer] a numerical value representing the currently

set leader type.

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 122
def leader_type
end
leader_type=(type) click to toggle source

The leader_type = method sets the leader type.

Valid leader types are 0 for none, 1 for View-based, and 2 for Pushpin

@example

leader = text.leader_type=1

@param [Integer] type

A numerical value representing the leader type to be
set.

@return [Integer] a numerical value representing the leader type

you just set.

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 140
def leader_type=(type)
end
line_weight() click to toggle source

The line_weight method returns a line weight in number of pixels.

Defalt line weight is 1.

@example

weight = text.line_weight

@return [Integer] the line weight in pixels

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 153
def line_weight
end
line_weight=(weight) click to toggle source

The line_weight= method sets the line weight in pixels.

Default line weight is 1.

@example

newweight = text.line_weight = 4

@param [Integer] weight

The line weight to be set (in pixels).

@return [Integer] The line weight that has been set.

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 169
def line_weight=(weight)
end
point() click to toggle source

The point method is used to get the point associated with the text.

@example

point3d = text.point

@return [Geom::Point3d] a Point3d object.

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 180
def point
end
point=(point3d) click to toggle source

The point= method is used to set the point associated with the text.

@example

status = text.point = point3d

@param [Geom::Point3d] point3d

A Point3d object.

@return [Geom::Point3d] true if successful, false if unsuccessful.

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 194
def point=(point3d)
end
set_text(textstring) click to toggle source

The set_text method is used to set the text within a Text object without recording an Undo operation.

@example

text = text.set_text "This is another text"

@param [String] textstring

The string to be set within the Text object.

@return [Sketchup::Text] the Text object

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 209
def set_text(textstring)
end
text() click to toggle source

The text method is used to retrieve the string version of a Text object.

@example

textstring = text.text

@return [String] the string representation of the Text

object

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 221
def text
end
text=(textstring) click to toggle source

The text= method is used to set the string version of a Text object.

@example

textstring = text.text= "text"

@param [String] textstring

@return [String] the newly set text

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 234
def text=(textstring)
end
vector() click to toggle source

The vector method is used to get the vector associated with the text.

@example

vector = text.vector

@return [Geom::Vector3d] a Vector3d object.

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 245
def vector
end
vector=(vector) click to toggle source

The vector= method is used to set the vector associated with the text.

@example

vector = text.vector

@param [Geom::Vector3d] vector

A Vector3d object.

@return [Geom::Vector3d]

@version SketchUp 6.0

# File lib/sketchup-api-stubs/stubs/Sketchup/Text.rb, line 259
def vector=(vector)
end