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_typeObject

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:

  • arrow - a numerical representation for the type of arrow.

Version:

  • SketchUp 6.0

#arrow_type(type) ⇒ Object

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

Returns arrow - a numerical representation for the type of arrow.

Parameters:

  • type

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

Returns:

  • arrow - a numerical representation for the type of arrow.

Version:

  • SketchUp 6.0

#display_leader=(status) ⇒ Object

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

Returns status - the status that you set.

Parameters:

  • status

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

Returns:

  • status - the status that you set.

Version:

  • SketchUp 6.0

#display_leader?Object

The display_leader? method returns the status of the leader.

Examples:

status = text.display_leader

Returns:

  • status - true if the leader is being displayed, false if it is not displayed.

  • (Boolean)

Version:

  • SketchUp 6.0

#has_leader?Object

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

Examples:

status = text.has_leader

Returns:

  • status - true if the Text object has a leader. False if the Text object does not have a leader.

  • (Boolean)

Version:

  • SketchUp 6.0

#leader_typeObject

The leader_type method retrieves the currently set leader type.

Examples:

leader = text.leader_type

Returns:

  • leader - a numerical value representing the currently set leader type.

Version:

  • SketchUp 6.0

#leader_type=(type) ⇒ Object

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

Returns leader - a numerical value representing the leader type you just set.

Parameters:

  • type

    A numerical value representing the leader type to be set.

Returns:

  • leader - a numerical value representing the leader type you just set.

Version:

  • SketchUp 6.0

#line_weightObject

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

Defalt line weight is 1.

Examples:

weight = text.line_weight

Returns:

  • lineweight - the line weight in pixels

Version:

  • SketchUp 6.0

#line_weight=(weight) ⇒ Object

The line_weight= method sets the line weight in pixels.

Default line weight is 1.

Examples:

newweight = text.line_weight = 4

Returns The line weight that has been set.

Parameters:

  • weight

    The line weight to be set (in pixels).

Returns:

  • The line weight that has been set.

Version:

  • SketchUp 6.0

#pointObject

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

Examples:

point3d = text.point

Returns:

  • point - a Point3d object.

Version:

  • SketchUp 6.0

#point=(point3d) ⇒ Object

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

Examples:

status = text.point = point3d

Returns status - true if successful, false if unsuccessful.

Parameters:

  • point3d

    A Point3d object.

Returns:

  • status - true if successful, false if unsuccessful.

Version:

  • SketchUp 6.0

#set_text(textstring) ⇒ Object

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"

Returns text - the Text object

Parameters:

  • textstring

    The string to be set within the Text object.

Returns:

  • text - the Text object

Version:

  • SketchUp 6.0

#textObject

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

Examples:

textstring = text.text

Returns:

  • textstring - the string representation of the Text object

Version:

  • SketchUp 6.0

#text=(textstring) ⇒ Object

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

Examples:

textstring = text.text= "text"

Returns textstring - the newly set text

Parameters:

  • textstring

Returns:

  • textstring - the newly set text

Version:

  • SketchUp 6.0

#vectorObject

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

Examples:

vector = text.vector

Returns:

  • vector - a Vector3d object.

Version:

  • SketchUp 6.0

#vector=(vector) ⇒ Object

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

Examples:

vector = text.vector

Returns success - true if successful.

Parameters:

  • vector

    A Vector3d object.

Returns:

  • success - true if successful.

Version:

  • SketchUp 6.0