LayOut C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Enumerations | Functions
lineardimension.h File Reference
#include <LayOutAPI/common.h>
#include <LayOutAPI/geometry/geometry.h>
#include <LayOutAPI/model/defs.h>

Go to the source code of this file.

Enumerations

enum  LOLinearDimensionLeaderLineType {
  LOLinearDimensionLeaderLineType_SingleSegment = 0, LOLinearDimensionLeaderLineType_TwoSegment, LOLinearDimensionLeaderLineType_Bezier, LOLinearDimensionLeaderLineType_Hidden,
  LONumLinearDimensionLeaderLineTypes
}
 Defines the different types of leader lines for a linear dimension entity. More...
 

Functions

LO_RESULT LOLinearDimensionCreate (LOLinearDimensionRef *dimension, const LOPoint2D *start_point, const LOPoint2D *end_point, double height)
 Creates a new disconnected linear dimension object. More...
 
LO_RESULT LOLinearDimensionAddReference (LOLinearDimensionRef dimension)
 Adds a reference to a linear dimension object. More...
 
LO_RESULT LOLinearDimensionRelease (LOLinearDimensionRef *dimension)
 Releases a linear dimension object. The object will be invalidated if releasing the last reference. More...
 
LO_EXPORT LOLinearDimensionRef LOLinearDimensionFromEntity (LOEntityRef entity)
 Converts from a LOEntityRef to a LOLinearDimensionRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LOLinearDimensionRef. More...
 
LO_EXPORT LOEntityRef LOLinearDimensionToEntity (LOLinearDimensionRef dimension)
 Converts from a LOLinearDimensionRef to a LOEntityRef. This is essentially an upcast operation. More...
 
LO_RESULT LOLinearDimensionGetExplodedEntities (LOLinearDimensionRef dimension, LOEntityListRef entity_list)
 Creates the entities that represent the dimension in its exploded form and adds them to a LOEntityListRef. It is NOT necessary to explicitly release these entities, since LOEntityListRef itself adds a reference to the entities and will release them when they are removed from the list or when the list is released. Depending on the appearance of the dimension being exploded, this may return anywhere from four to six entities. Start extension line, end extension line, one or two dimension lines, dimension text, optional leader line. More...
 
LO_RESULT LOLinearDimensionGetUsesCustomText (LOLinearDimensionRef dimension, bool *use_custom_text)
 Gets whether or not the dimension text uses custom text. When true, the dimension text will display a custom string that doesn't change. When false, the dimension text will display the length measurement and will update automatically. More...
 
LO_RESULT LOLinearDimensionSetUsesCustomText (LOLinearDimensionRef dimension, bool use_custom_text)
 Sets whether or not the dimension text uses custom text. When true, the dimension text will display a custom string that doesn't change. When false, the dimension text will display the length measurement and will update automatically. More...
 
LO_RESULT LOLinearDimensionCreateDimensionTextCopy (LOLinearDimensionRef dimension, LOFormattedTextRef *text)
 Creates a copy of the dimension text's LOFormattedTextRef object. More...
 
LO_RESULT LOLinearDimensionSetDimensionText (LOLinearDimensionRef dimension, LOFormattedTextRef text)
 Sets the text of the dimension from a LOFormattedTextRef object. The dimension lines may be adjusted if the text has been re-positioned. More...
 
LO_RESULT LOLinearDimensionGetLeaderLineType (LOLinearDimensionRef dimension, LOLinearDimensionLeaderLineType *leader_line_type)
 Gets the type of leader line the linear dimension is using. More...
 
LO_RESULT LOLinearDimensionSetLeaderLineType (LOLinearDimensionRef dimension, LOLinearDimensionLeaderLineType leader_line_type)
 Sets the type of leader line the linear dimension is using. New control points will be generated if changing to a two segment or bezier leader line type. Setting the leader line type to LOLinearDimensionLeaderLineType_Hidden will not move the dimension text. More...
 
LO_RESULT LOLinearDimensionGetUsesAutoScale (LOLinearDimensionRef dimension, bool *use_auto_scale)
 Gets whether or not the scale for the dimension length text is set automatically. More...
 
LO_RESULT LOLinearDimensionSetUsesAutoScale (LOLinearDimensionRef dimension, bool use_auto_scale)
 Sets whether or not the scale for the dimension length text is set automatically. More...
 
LO_RESULT LOLinearDimensionGetScale (LOLinearDimensionRef dimension, double *scale)
 Gets the scale being used for the dimension length text. More...
 
LO_RESULT LOLinearDimensionSetScale (LOLinearDimensionRef dimension, double scale)
 Sets the scale being used for the dimension length text. This will also make the scale not use auto-scale. More...
 
LO_RESULT LOLinearDimensionGetStartConnectionPoint (LOLinearDimensionRef dimension, LOPoint2D *point)
 Gets the page location for the first connection. More...
 
LO_RESULT LOLinearDimensionSetStartConnectionPoint (LOLinearDimensionRef dimension, LOPoint2D *point)
 Sets the page location for the first connection. This will cause the dimension to become disconnected. To make a connected dimension, call LOLinearDimensionConnectTo. More...
 
LO_RESULT LOLinearDimensionGetEndConnectionPoint (LOLinearDimensionRef dimension, LOPoint2D *point)
 Gets the page location for the second connection. This will cause the dimension to become disconnected. To make a connected dimension, call LOLinearDimensionConnectTo. More...
 
LO_RESULT LOLinearDimensionSetEndConnectionPoint (LOLinearDimensionRef dimension, LOPoint2D *point)
 Sets the page location for the second connection. More...
 
LO_RESULT LOLinearDimensionGetStartExtentPoint (LOLinearDimensionRef dimension, LOPoint2D *point)
 Gets the page location for the start of the dimension line. More...
 
LO_RESULT LOLinearDimensionSetStartExtentPoint (LOLinearDimensionRef dimension, LOPoint2D *point)
 Sets the page location for the start of the dimension line. This will also adjust the end of the dimension line to maintain the correct dimension line length. More...
 
LO_RESULT LOLinearDimensionGetEndExtentPoint (LOLinearDimensionRef dimension, LOPoint2D *point)
 Gets the page location for the end of the dimension line. More...
 
LO_RESULT LOLinearDimensionSetEndExtentPoint (LOLinearDimensionRef dimension, LOPoint2D *point)
 Sets the page location for the end of the dimension line. This will also adjust the start of the dimension line to maintain the correct dimension line length. More...
 
LO_RESULT LOLinearDimensionGetStartOffsetPoint (LOLinearDimensionRef dimension, LOPoint2D *point)
 Gets the page location for the start of the first extension line. The first extension line runs from this offset point to the start extent point. More...
 
LO_RESULT LOLinearDimensionGetEndOffsetPoint (LOLinearDimensionRef dimension, LOPoint2D *point)
 Gets the page location for the start of the second extension line. The second extension line runs from this offset point to the end extent point. More...
 
LO_RESULT LOLinearDimensionSetStartOffsetLength (LOLinearDimensionRef dimension, double length)
 Sets the length of the offset from the first connection point to the start of the first extension line. The connection and extent points will not move. More...
 
LO_RESULT LOLinearDimensionSetEndOffsetLength (LOLinearDimensionRef dimension, double length)
 Sets the length of the offset from the second connection point to the start of the second extension line. The connection and extent points will not move. More...
 
LO_RESULT LOLinearDimensionConnectTo (LOLinearDimensionRef dimension, LOConnectionPointRef start_point, LOConnectionPointRef end_point)
 Connects the linear dimension to the given connection points. If both the linear dimension and the connection point's entities are on non-shared layers, they must be on the same page. More...
 
LO_RESULT LOLinearDimensionDisconnect (LOLinearDimensionRef dimension)
 Disconnects the linear dimension from its connection points. The dimension will not be adjusted by disconnecting from its connection points. More...
 

Enumeration Type Documentation

Defines the different types of leader lines for a linear dimension entity.

Enumerator
LOLinearDimensionLeaderLineType_SingleSegment 

Single segment leader line.

LOLinearDimensionLeaderLineType_TwoSegment 

Two segment leader line.

LOLinearDimensionLeaderLineType_Bezier 

Curved Bezier leader line.

LOLinearDimensionLeaderLineType_Hidden 

No visible leader line.

LONumLinearDimensionLeaderLineTypes 

Function Documentation

LO_RESULT LOLinearDimensionAddReference ( LOLinearDimensionRef  dimension)

Adds a reference to a linear dimension object.

Parameters
[in]dimensionThe linear dimension object.
Returns
LO_RESULT LOLinearDimensionConnectTo ( LOLinearDimensionRef  dimension,
LOConnectionPointRef  start_point,
LOConnectionPointRef  end_point 
)

Connects the linear dimension to the given connection points. If both the linear dimension and the connection point's entities are on non-shared layers, they must be on the same page.

Parameters
[in]dimensionThe linear dimension object.
[in]start_pointThe first connection point object.
[in]end_pointThe second connection point object.
Returns
LO_RESULT LOLinearDimensionCreate ( LOLinearDimensionRef dimension,
const LOPoint2D start_point,
const LOPoint2D end_point,
double  height 
)

Creates a new disconnected linear dimension object.

Parameters
[out]dimensionThe linear dimension object
[in]start_pointWhere the dimension should start
[in]end_pointWhere the dimension should end
[in]heightDistance from the start and end points to the dimension line
Returns
LO_RESULT LOLinearDimensionCreateDimensionTextCopy ( LOLinearDimensionRef  dimension,
LOFormattedTextRef text 
)

Creates a copy of the dimension text's LOFormattedTextRef object.

Note
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 in LayOut 2020.1, API 5.1.
Parameters
[in]dimensionThe linear dimension object.
[out]textThe formatted text object.
Returns
LO_RESULT LOLinearDimensionDisconnect ( LOLinearDimensionRef  dimension)

Disconnects the linear dimension from its connection points. The dimension will not be adjusted by disconnecting from its connection points.

Parameters
[in]dimensionThe linear dimension object.
Returns
LO_EXPORT LOLinearDimensionRef LOLinearDimensionFromEntity ( LOEntityRef  entity)

Converts from a LOEntityRef to a LOLinearDimensionRef. This is essentially a downcast operation so the given LOEntityRef must be convertible to a LOLinearDimensionRef.

Parameters
[in]entityThe entity object.
Returns
  • The converted LOLinearDimensionRef if the downcast operation succeeds
  • If not, the returned reference will be invalid
LO_RESULT LOLinearDimensionGetEndConnectionPoint ( LOLinearDimensionRef  dimension,
LOPoint2D point 
)

Gets the page location for the second connection. This will cause the dimension to become disconnected. To make a connected dimension, call LOLinearDimensionConnectTo.

Parameters
[in]dimensionThe linear dimension object.
[out]pointThe position of the second control point.
Returns
LO_RESULT LOLinearDimensionGetEndExtentPoint ( LOLinearDimensionRef  dimension,
LOPoint2D point 
)

Gets the page location for the end of the dimension line.

Parameters
[in]dimensionThe linear dimension object.
[out]pointThe position of the end of the dimension line.
Returns
LO_RESULT LOLinearDimensionGetEndOffsetPoint ( LOLinearDimensionRef  dimension,
LOPoint2D point 
)

Gets the page location for the start of the second extension line. The second extension line runs from this offset point to the end extent point.

Parameters
[in]dimensionThe linear dimension object.
[out]pointThe position of the end of the dimension line.
Returns
LO_RESULT LOLinearDimensionGetExplodedEntities ( LOLinearDimensionRef  dimension,
LOEntityListRef  entity_list 
)

Creates the entities that represent the dimension in its exploded form and adds them to a LOEntityListRef. It is NOT necessary to explicitly release these entities, since LOEntityListRef itself adds a reference to the entities and will release them when they are removed from the list or when the list is released. Depending on the appearance of the dimension being exploded, this may return anywhere from four to six entities. Start extension line, end extension line, one or two dimension lines, dimension text, optional leader line.

Parameters
[in]dimensionThe linear dimension object.
[in]entity_listThe entity list object to add the new entities to.
Returns
LO_RESULT LOLinearDimensionGetLeaderLineType ( LOLinearDimensionRef  dimension,
LOLinearDimensionLeaderLineType leader_line_type 
)

Gets the type of leader line the linear dimension is using.

Parameters
[in]dimensionThe linear dimension object.
[out]leader_line_typeThe leader line type.
Returns
LO_RESULT LOLinearDimensionGetScale ( LOLinearDimensionRef  dimension,
double *  scale 
)

Gets the scale being used for the dimension length text.

Parameters
[in]dimensionThe linear dimension object.
[out]scaleThe dimension text scale.
Returns
LO_RESULT LOLinearDimensionGetStartConnectionPoint ( LOLinearDimensionRef  dimension,
LOPoint2D point 
)

Gets the page location for the first connection.

Parameters
[in]dimensionThe linear dimension object.
[out]pointThe position of the first connection point.
Returns
LO_RESULT LOLinearDimensionGetStartExtentPoint ( LOLinearDimensionRef  dimension,
LOPoint2D point 
)

Gets the page location for the start of the dimension line.

Parameters
[in]dimensionThe linear dimension object.
[out]pointThe position of the start of the dimension line.
Returns
LO_RESULT LOLinearDimensionGetStartOffsetPoint ( LOLinearDimensionRef  dimension,
LOPoint2D point 
)

Gets the page location for the start of the first extension line. The first extension line runs from this offset point to the start extent point.

Parameters
[in]dimensionThe linear dimension object.
[out]pointThe position of the start of the extension line.
Returns
LO_RESULT LOLinearDimensionGetUsesAutoScale ( LOLinearDimensionRef  dimension,
bool *  use_auto_scale 
)

Gets whether or not the scale for the dimension length text is set automatically.

Parameters
[in]dimensionThe linear dimension object.
[out]use_auto_scaleWhether the dimension is using auto scale or not.
Returns
LO_RESULT LOLinearDimensionGetUsesCustomText ( LOLinearDimensionRef  dimension,
bool *  use_custom_text 
)

Gets whether or not the dimension text uses custom text. When true, the dimension text will display a custom string that doesn't change. When false, the dimension text will display the length measurement and will update automatically.

Parameters
[in]dimensionThe linear dimension object.
[out]use_custom_textWhether the dimension uses custom text.
Returns
LO_RESULT LOLinearDimensionRelease ( LOLinearDimensionRef dimension)

Releases a linear dimension object. The object will be invalidated if releasing the last reference.

Parameters
[in]dimensionThe linear dimension object.
Returns
LO_RESULT LOLinearDimensionSetDimensionText ( LOLinearDimensionRef  dimension,
LOFormattedTextRef  text 
)

Sets the text of the dimension from a LOFormattedTextRef object. The dimension lines may be adjusted if the text has been re-positioned.

Parameters
[in]dimensionThe linear dimension object.
[in]textThe formatted text object.
Returns
LO_RESULT LOLinearDimensionSetEndConnectionPoint ( LOLinearDimensionRef  dimension,
LOPoint2D point 
)

Sets the page location for the second connection.

Parameters
[in]dimensionThe linear dimension object.
[in]pointThe position for the second control point.
Returns
LO_RESULT LOLinearDimensionSetEndExtentPoint ( LOLinearDimensionRef  dimension,
LOPoint2D point 
)

Sets the page location for the end of the dimension line. This will also adjust the start of the dimension line to maintain the correct dimension line length.

Parameters
[in]dimensionThe linear dimension object.
[in]pointThe position of the end of the dimension line.
Returns
LO_RESULT LOLinearDimensionSetEndOffsetLength ( LOLinearDimensionRef  dimension,
double  length 
)

Sets the length of the offset from the second connection point to the start of the second extension line. The connection and extent points will not move.

Parameters
[in]dimensionThe linear dimension object.
[in]lengthThe length the offset to the extension line should be.
Returns
LO_RESULT LOLinearDimensionSetLeaderLineType ( LOLinearDimensionRef  dimension,
LOLinearDimensionLeaderLineType  leader_line_type 
)

Sets the type of leader line the linear dimension is using. New control points will be generated if changing to a two segment or bezier leader line type. Setting the leader line type to LOLinearDimensionLeaderLineType_Hidden will not move the dimension text.

Parameters
[in]dimensionThe linear dimension object.
[in]leader_line_typeThe leader line type.
Returns
LO_RESULT LOLinearDimensionSetScale ( LOLinearDimensionRef  dimension,
double  scale 
)

Sets the scale being used for the dimension length text. This will also make the scale not use auto-scale.

Parameters
[in]dimensionThe linear dimension object.
[in]scaleThe new scale to use.
Returns
LO_RESULT LOLinearDimensionSetStartConnectionPoint ( LOLinearDimensionRef  dimension,
LOPoint2D point 
)

Sets the page location for the first connection. This will cause the dimension to become disconnected. To make a connected dimension, call LOLinearDimensionConnectTo.

Parameters
[in]dimensionThe linear dimension object.
[in]pointThe position for the first connection point.
Returns
LO_RESULT LOLinearDimensionSetStartExtentPoint ( LOLinearDimensionRef  dimension,
LOPoint2D point 
)

Sets the page location for the start of the dimension line. This will also adjust the end of the dimension line to maintain the correct dimension line length.

Parameters
[in]dimensionThe linear dimension object.
[in]pointThe position of the start of the dimension line.
Returns
LO_RESULT LOLinearDimensionSetStartOffsetLength ( LOLinearDimensionRef  dimension,
double  length 
)

Sets the length of the offset from the first connection point to the start of the first extension line. The connection and extent points will not move.

Parameters
[in]dimensionThe linear dimension object.
[in]lengthThe length the offset to the extension line should be.
Returns
LO_RESULT LOLinearDimensionSetUsesAutoScale ( LOLinearDimensionRef  dimension,
bool  use_auto_scale 
)

Sets whether or not the scale for the dimension length text is set automatically.

Parameters
[in]dimensionThe linear dimension object.
[in]use_auto_scaleWhether the dimension should use auto scale or not.
Returns
LO_RESULT LOLinearDimensionSetUsesCustomText ( LOLinearDimensionRef  dimension,
bool  use_custom_text 
)

Sets whether or not the dimension text uses custom text. When true, the dimension text will display a custom string that doesn't change. When false, the dimension text will display the length measurement and will update automatically.

Parameters
[in]dimensionThe linear dimension object.
[in]use_custom_textWhether or not the dimension should use custom text.
Returns
LO_EXPORT LOEntityRef LOLinearDimensionToEntity ( LOLinearDimensionRef  dimension)

Converts from a LOLinearDimensionRef to a LOEntityRef. This is essentially an upcast operation.

Parameters
[in]dimensionThe linear dimension object.
Returns
  • The converted LOEntityRef if dimension is a valid object
  • If not, the returned reference will be invalid