Class: AMS::MultiLineText

Inherits:
Object
  • Object
show all
Defined in:
docs/ams/multi_line_text.rb

Overview

Note:

Many of the functions that make a change influence the undo stack. Wrap them with a start/commit operation when/if desired.

Note:

Since 3.5.0, when/if a MultiLineText object is garbage collected, the associated text entity is erased.

Note:

Since 3.5.0, cloning a MultiLineText object now creates a new text entity, rather than linking to the original one.

MultiLineText is a SketchUp text wrapped with custom methods for logging information.

Since:

  • 2.0.0

Instance Method Summary collapse

Constructor Details

#initialize(x, y) ⇒ MultiLineText

Create a new MultiLineText object.

Parameters:

  • x (Integer)

    The horizontal position in pixels from the upper-left corner of the viewport.

  • y (Integer)

    The vertical position in pixels from the upper-left corner of the viewport.

Since:

  • 2.0.0

Instance Method Details

#clearnil

Clear all data.

Returns:

  • (nil)

Since:

  • 2.0.0

#countInteger

Get number of lines logged to screen.

Returns:

  • (Integer)

Since:

  • 2.0.0

#get_entitySketchup::Text?

Get entity associated with the text.

Returns:

  • (Sketchup::Text, nil)

Since:

  • 3.5.0

#get_introString

Get text title/top description.

Returns:

  • (String)

Since:

  • 2.0.0

#get_limitInteger

Get line limit.

Returns:

  • (Integer)

Since:

  • 2.0.0

#get_positionArray<(Integer, Integer)>

Note:

If the associated text entity is moved, the position remains unchanged until #set_position is called.

Get screen position of the associated text entity.

Returns:

  • (Array<(Integer, Integer)>)

    [x,y] The text position from the upper-left corner of the viewport.

Since:

  • 3.5.0

#line_numbers_visible?Boolean

Determine whether line numbers are visible.

Returns:

  • (Boolean)

Since:

  • 2.0.0

Add text to the current line.

Parameters:

  • str (String)

Returns:

  • (nil)

Since:

  • 2.0.0

#puts(str) ⇒ nil

Add text to the new line.

Parameters:

  • str (String)

Returns:

  • (nil)

Since:

  • 2.0.0

#removenil

Remove text object and reset all data.

Returns:

  • (nil)

Since:

  • 2.0.0

#set_entity(entity) ⇒ nil

Set entity associated with the text.

Parameters:

  • entity (Sketchup::Text)

Returns:

  • (nil)

Since:

  • 3.5.0

#set_intro(intro) ⇒ nil

Set text title/top description.

Parameters:

  • intro (String)

Returns:

  • (nil)

Since:

  • 2.0.0

#set_limit(limit) ⇒ nil

Set line limit.

Parameters:

  • limit (Integer)

    A value between 1 and 1000.

Returns:

  • (nil)

Since:

  • 2.0.0

#set_position(x, y) ⇒ nil

Note:

If the associated text entity is not locked to screen, this function stores the positions but does not move the entity.

Note:

Since moving Sketchup::Text requires some workarounds, this function closes the activate entity path, for a proper operation.

Note:

Wrap this function with a start/commit operation block.

Set screen position of the associated text entity.

Parameters:

  • x (Integer)

    The horizontal position in pixels from the upper-left corner of the viewport.

  • y (Integer)

    The vertical position in pixels from the upper-left corner of the viewport.

Returns:

  • (nil)

Since:

  • 3.5.0

#show_line_numbers(state) ⇒ nil

Show/hide line numbers.

Parameters:

  • state (Boolean)

Returns:

  • (nil)

Since:

  • 2.0.0