Class: AMS::MultiLineText

Inherits:
Object
  • Object
show all
Defined in:
Documentation/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 (Fixnum)

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

  • y (Fixnum)

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

Since:

  • 2.0.0


17
18
# File 'Documentation/ams/multi_line_text.rb', line 17

def initialize(x,y)
end

Instance Method Details

#clearnil

Clear all data.

Returns:

  • (nil)

Since:

  • 2.0.0


104
105
# File 'Documentation/ams/multi_line_text.rb', line 104

def clear
end

#countFixnum

Get number of lines logged to screen.

Returns:

  • (Fixnum)

Since:

  • 2.0.0


114
115
# File 'Documentation/ams/multi_line_text.rb', line 114

def count
end

#get_entitySketchup::Text?

Get entity associated with the text.

Returns:

  • (Sketchup::Text, nil)

Since:

  • 3.5.0


23
24
# File 'Documentation/ams/multi_line_text.rb', line 23

def get_entity
end

#get_introString

Get text title/top description.

Returns:

  • (String)

Since:

  • 2.0.0


70
71
# File 'Documentation/ams/multi_line_text.rb', line 70

def get_intro
end

#get_limitFixnum

Get line limit.

Returns:

  • (Fixnum)

Since:

  • 2.0.0


59
60
# File 'Documentation/ams/multi_line_text.rb', line 59

def get_limit
end

#get_positionArray<(Fixnum, Fixnum)>

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<(Fixnum, Fixnum)>)

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

Since:

  • 3.5.0


39
40
# File 'Documentation/ams/multi_line_text.rb', line 39

def get_position
end

#line_numbers_visible?Boolean

Determine whether line numbers are visible.

Returns:

  • (Boolean)

Since:

  • 2.0.0


87
88
# File 'Documentation/ams/multi_line_text.rb', line 87

def line_numbers_visible?
end

Add text to the current line.

Parameters:

  • str (String)

Returns:

  • (nil)

Since:

  • 2.0.0


93
94
# File 'Documentation/ams/multi_line_text.rb', line 93

def print(str)
end

#puts(str) ⇒ nil

Add text to the new line.

Parameters:

  • str (String)

Returns:

  • (nil)

Since:

  • 2.0.0


99
100
# File 'Documentation/ams/multi_line_text.rb', line 99

def puts(str)
end

#removenil

Remove text object and reset all data.

Returns:

  • (nil)

Since:

  • 2.0.0


109
110
# File 'Documentation/ams/multi_line_text.rb', line 109

def remove
end

#set_entity(entity) ⇒ nil

Set entity associated with the text.

Parameters:

  • entity (Sketchup::Text)

Returns:

  • (nil)

Since:

  • 3.5.0


30
31
# File 'Documentation/ams/multi_line_text.rb', line 30

def set_entity(entity)
end

#set_intro(intro) ⇒ nil

Set text title/top description.

Parameters:

  • intro (String)

Returns:

  • (nil)

Since:

  • 2.0.0


76
77
# File 'Documentation/ams/multi_line_text.rb', line 76

def set_intro(intro)
end

#set_limit(limit) ⇒ nil

Set line limit.

Parameters:

  • limit (Fixnum)

    A value between 1 and 1000.

Returns:

  • (nil)

Since:

  • 2.0.0


65
66
# File 'Documentation/ams/multi_line_text.rb', line 65

def set_limit(limit)
end

#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 (Fixnum)

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

  • y (Fixnum)

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

Returns:

  • (nil)

Since:

  • 3.5.0


54
55
# File 'Documentation/ams/multi_line_text.rb', line 54

def set_position(x,y)
end

#show_line_numbers(state) ⇒ nil

Show/hide line numbers.

Parameters:

  • state (Boolean)

Returns:

  • (nil)

Since:

  • 2.0.0


82
83
# File 'Documentation/ams/multi_line_text.rb', line 82

def show_line_numbers(state)
end