Class: Sketchup::Text

Inherits:
Drawingelement show all

Overview

The Text class contains method to manipulate a Text entity 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

#arrow_typeInteger

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.

Examples:

type = text.arrow_type=0

Returns:

  • (Integer)

    a numerical representation for the type of arrow.

Version:

  • SketchUp 6.0

#arrow_type=(type) ⇒ Integer

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.

Examples:

arrow = text.arrow_type=type

Parameters:

  • type (Integer)

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

Returns:

  • (Integer)

    a numerical representation for the type of arrow.

Version:

  • SketchUp 6.0

#attached_toArray(Sketchup::InstancePath, Geom::Point3d)?

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

Examples:

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

Returns:

Version:

  • SketchUp 2019

#attached_to=(path) ⇒ Object

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

Examples:

# 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)]

Parameters:

Version:

  • SketchUp 2019

#display_leader=(status) ⇒ Boolean

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.

Examples:

leader = text.display_leader=true

Parameters:

  • status (Boolean)

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

Returns:

  • (Boolean)

    the status that you set.

Version:

  • SketchUp 6.0

#display_leader?Boolean

The display_leader? method returns the status of the leader.

Examples:

status = text.display_leader

Returns:

  • (Boolean)

Version:

  • SketchUp 6.0

#has_leader?Boolean

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

Examples:

status = text.has_leader

Returns:

  • (Boolean)

Version:

  • SketchUp 6.0

#leader_typeInteger

The leader_type method retrieves the currently set leader type.

Examples:

leader = text.leader_type

Returns:

  • (Integer)

    a numerical value representing the currently set leader type.

Version:

  • SketchUp 6.0

#leader_type=(type) ⇒ Integer

The leader_type = method sets the leader type.

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

Examples:

leader = text.leader_type=1

Parameters:

  • type (Integer)

    A numerical value representing the leader type to be set.

Returns:

  • (Integer)

    a numerical value representing the leader type you just set.

Version:

  • SketchUp 6.0

#line_weightInteger

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

Defalt line weight is 1.

Examples:

weight = text.line_weight

Returns:

  • (Integer)

    the line weight in pixels

Version:

  • SketchUp 6.0

#line_weight=(weight) ⇒ Integer

The line_weight= method sets the line weight in pixels.

Default line weight is 1.

Examples:

newweight = text.line_weight = 4

Parameters:

  • weight (Integer)

    The line weight to be set (in pixels).

Returns:

  • (Integer)

    The line weight that has been set.

Version:

  • SketchUp 6.0

#pointGeom::Point3d

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

Examples:

point3d = text.point

Returns:

Version:

  • SketchUp 6.0

#point=(point3d) ⇒ Geom::Point3d

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

Examples:

status = text.point = point3d

Parameters:

Returns:

Version:

  • SketchUp 6.0

#set_text(textstring) ⇒ Sketchup::Text

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

Examples:

text = text.set_text "This is another text"

Parameters:

  • textstring (String)

    The string to be set within the Text object.

Returns:

Version:

  • SketchUp 6.0

#textString

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

Examples:

textstring = text.text

Returns:

  • (String)

    the string representation of the Text object

Version:

  • SketchUp 6.0

#text=(textstring) ⇒ String

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

Examples:

textstring = text.text= "text"

Parameters:

Returns:

  • (String)

    the newly set text

Version:

  • SketchUp 6.0

#vectorGeom::Vector3d

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

Examples:

vector = text.vector

Returns:

Version:

  • SketchUp 6.0

#vector=(vector) ⇒ Geom::Vector3d

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

Examples:

vector = text.vector

Parameters:

Returns:

Version:

  • SketchUp 6.0