123456789_123456789_123456789_123456789_123456789_

Class: Sketchup::Text

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

Overview

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

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

#arrow_typeInteger (rw)

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 (rw)

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)? (rw)

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

Version:

  • SketchUp 2019

#attached_to=(path) (rw)

The #attached_to= method will attach the Text to another Sketchup::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 (rw)

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 (rw)

The display_leader? method returns the status of the leader.

Examples:

status = text.display_leader

Version:

  • SketchUp 6.0

#has_leader?Boolean (readonly)

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

Examples:

status = text.has_leader

Version:

  • SketchUp 6.0

#leader_typeInteger (rw)

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 (rw)

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 (rw)

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 (rw)

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 (rw)

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 (rw)

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

Examples:

status = text.point = point3d

Parameters:

Returns:

Version:

  • SketchUp 6.0

#textString (rw)

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 (rw)

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 (rw)

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 (rw)

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

Examples:

vector = text.vector

Parameters:

Version:

  • SketchUp 6.0

Instance Method Details

#set_text(textstring) ⇒ 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:

  • (Text)

    the Text object

Version:

  • SketchUp 6.0