Class: Layout::LinearDimension
| Relationships | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Entity
|
|
|
Instance Chain:
self,
Entity
|
|
| Inherits: |
Layout::Entity
|
Overview
References a linear dimension entity. A LinearDimension is composed of the following sub-entities:
-
two ‘extension lines’ that connect to the
Entitybeing dimensioned. -
a ‘dimension line’ connecting the ends of the leaders. This may be represented by one or two
Paths depending on appearance. -
an optional ‘leader line’ that is used for small
LinearDimensions. -
a ‘dimension text’ that displays the
LinearDimension‘s text.
There are six points that may be modified for a LinearDimension:
-
two ‘connection points’ that define the start and end of the
LinearDimension. -
two ‘extent points’ that define the start and end of the dimension line and are the ends of the two extension lines.
-
two ‘offset points’ that define the starting points of the extension lines.
Constant Summary
-
LEADER_LINE_TYPE_BEZIER =
# File 'lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb', line 25
Constants
nil -
LEADER_LINE_TYPE_HIDDEN =
# File 'lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb', line 26
Stub value.
nil -
LEADER_LINE_TYPE_SINGLE_SEGMENT =
# File 'lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb', line 27
Stub value.
nil -
LEADER_LINE_TYPE_TWO_SEGMENT =
# File 'lib/sketchup-api-stubs/stubs/Layout/LinearDimension.rb', line 28
Stub value.
nil
Class Method Summary
-
.new(start_point, end_point, height) ⇒ Layout::LinearDimension
constructor
The
#initializemethod creates a new disconnectedLinearDimension.
Instance Attribute Summary
-
#auto_scale=(uses_auto_scale)
rw
The #auto_scale= method sets whether the scale for the
LinearDimensionis set automatically. -
#auto_scale? ⇒ Boolean
rw
The #auto_scale? method returns whether the scale for the
LinearDimensionis set automatically. -
#custom_text=(uses_custom_text)
rw
The #custom_text= method sets whether the
LinearDimensionuses custom text. -
#custom_text? ⇒ Boolean
rw
The #custom_text? method returns whether the
LinearDimensionuses custom text. -
#end_connection_point ⇒ Geom::Point2d
rw
The #end_connection_point method returns the paper space location for the second connection.
-
#end_connection_point=(end_point)
rw
The #end_connection_point= method sets the paper space location for the second connection.
-
#end_extent_point ⇒ Geom::Point2d
rw
The #end_extent_point method returns the paper space location for the end of the dimension line.
-
#end_extent_point=(end_extent)
rw
The #end_extent_point= method sets the paper space location for the end of the dimension line.
-
#end_offset_length=(offset_length)
writeonly
The #end_offset_length= method sets the length of the offset from the second
ConnectionPointto the start of the second extension line. -
#leader_line_type ⇒ Integer
rw
The #leader_line_type method returns the type of leader line the
LinearDimensionis using. -
#leader_line_type=(type)
rw
The #leader_line_type= method sets the type of leader line the
LinearDimensionis using. -
#scale ⇒ Numeric
rw
The #scale method returns the scale being used for the
LinearDimension. -
#scale=(scale)
rw
The #scale= method sets the scale being used for the
LinearDimension. -
#start_connection_point ⇒ Geom::Point2d
rw
The #start_connection_point method returns the paper space location for the first connection.
-
#start_connection_point=(start_point)
rw
The #start_connection_point= method sets the paper space location for the first connection.
-
#start_extent_point ⇒ Geom::Point2d
rw
The #start_extent_point method returns the paper space location for the start of the dimension line.
-
#start_extent_point=(start_extent)
rw
The #start_extent_point= method sets the paper space location for the start of the dimension line.
-
#start_offset_length=(offset_length)
writeonly
The #start_offset_length= method sets the length of the offset from the first
ConnectionPointto the start of the first extension line. -
#text ⇒ Layout::FormattedText
rw
The #text method returns a copy of the
LinearDimension‘sFormattedText. -
#text=(formatted_text)
rw
The #text= method sets the
LinearDimension‘sFormattedText.
Entity - Inherited
| #locked= | The |
| #locked? | The |
| #on_shared_layer? | |
| #style | |
| #style= | |
| #untransformed_bounds | The |
| #untransformed_bounds= | The |
Instance Method Summary
-
#connect(start_connection, end_connection)
The #connect method connects the
LinearDimensionto one or twoEntitys using the providedConnectionPoints. -
#disconnect
The #disconnect method disconnects the
LinearDimensionfrom itsConnectionPoints. -
#end_offset_point ⇒ Geom::Point2d
The #end_offset_point method returns the paper space location for the end of the first extension line.
- #entities ⇒ Layout::Entities
-
#start_offset_point ⇒ Geom::Point2d
The #start_offset_point method returns the paper space location for the start of the first extension line.
Entity - Inherited
| #== | The |
| #bounds | The |
| #document | |
| #drawing_bounds | The |
| #group | |
| #layer_instance | The |
| #move_to_group | |
| #move_to_layer | |
| #page | |
| #transform! | The |
| #transformation | The |
Constructor Details
.new(start_point, end_point, height) ⇒ LinearDimension
The #initialize method creates a new disconnected LinearDimension.
Instance Attribute Details
#auto_scale=(uses_auto_scale) (rw)
The #auto_scale= method sets whether the scale for the LinearDimension is set automatically.
#auto_scale? ⇒ Boolean (rw)
The #auto_scale? method returns whether the scale for the LinearDimension is set automatically.
#custom_text=(uses_custom_text) (rw)
The #custom_text= method sets whether the LinearDimension uses custom text. When true, the LinearDimension will display a custom string that doesn’t change. When false, it will display the length measurement and will update automatically.
#custom_text? ⇒ Boolean (rw)
The #custom_text? method returns whether the LinearDimension uses custom text. When true, the LinearDimension will display a custom string that doesn’t change. When false, it will display the length measurement and will update automatically.
#end_connection_point ⇒ Geom::Point2d (rw)
The #end_connection_point method returns the paper space location for the second connection.
#end_connection_point=(end_point) (rw)
The #end_connection_point= method sets the paper space location for the second connection.
#end_extent_point ⇒ Geom::Point2d (rw)
The #end_extent_point method returns the paper space location for the end of the dimension line.
#end_extent_point=(end_extent) (rw)
The #end_extent_point= method sets the paper space location for the end of the dimension line.
#end_offset_length=(offset_length) (writeonly)
The #end_offset_length= method sets the length of the offset from the second ConnectionPoint to the start of the second extension line. The ConnectionPoint and extent point will not move.
#leader_line_type ⇒ Integer (rw)
The #leader_line_type method returns the type of leader line the LinearDimension is using.
The leader line type can be one of the following:
Layout::LinearDimension::LEADER_LINE_TYPE_SINGLE_SEGMENTLayout::LinearDimension::LEADER_LINE_TYPE_TWO_SEGMENTLayout::LinearDimension::LEADER_LINE_TYPE_BEZIERLayout::LinearDimension::LEADER_LINE_TYPE_HIDDEN
#leader_line_type=(type) (rw)
The #leader_line_type= method sets the type of leader line the LinearDimension is using.
The leader line type can be one of the following:
Layout::LinearDimension::LEADER_LINE_TYPE_SINGLE_SEGMENTLayout::LinearDimension::LEADER_LINE_TYPE_TWO_SEGMENTLayout::LinearDimension::LEADER_LINE_TYPE_BEZIERLayout::LinearDimension::LEADER_LINE_TYPE_HIDDEN
#scale ⇒ Numeric (rw)
The #scale method returns the scale being used for the LinearDimension.
#scale=(scale) (rw)
The #scale= method sets the scale being used for the LinearDimension.
#start_connection_point ⇒ Geom::Point2d (rw)
The #start_connection_point method returns the paper space location for the first connection.
#start_connection_point=(start_point) (rw)
The #start_connection_point= method sets the paper space location for the first connection.
#start_extent_point ⇒ Geom::Point2d (rw)
The #start_extent_point method returns the paper space location for the start of the dimension line.
#start_extent_point=(start_extent) (rw)
The #start_extent_point= method sets the paper space location for the start of the dimension line.
#start_offset_length=(offset_length) (writeonly)
The #start_offset_length= method sets the length of the offset from the first ConnectionPoint to the start of the first extension line. The ConnectionPoint and extent point will not move.
#text ⇒ Layout::FormattedText (rw)
With the addition of auto-text in dimensions for LayOut 2019.2, the copy of the dimension text incorrectly provided the plain text when requesting the display text. This has been fixed for LayOut 2020.1.
The #text method returns a copy of the LinearDimension‘s FormattedText.
#text=(formatted_text) (rw)
The #text= method sets the LinearDimension‘s FormattedText.
Instance Method Details
#connect(start_connection, end_connection)
#disconnect
The #disconnect method disconnects the LinearDimension from its ConnectionPoints. The dimension will not be adjusted by disconnecting from its ConnectionPoints.
#end_offset_point ⇒ Geom::Point2d
The #end_offset_point method returns the paper space location for the end of the first extension line. The first extension line runs from this offset point to the end extent point.
#entities ⇒ Layout::Entities
The #entities method returns the Entities that represent the LinearDimension in its exploded form. Depending on the appearance of the LinearDimension, this may return anywhere from four to six Entitys: start extension line, end extension line, one or two dimension lines, dimension text, and optionally the leader line.
#start_offset_point ⇒ Geom::Point2d
The #start_offset_point method returns the paper space location for the start of the first extension line. The first extension line runs from this offset point to the start extent point.