SketchUp C API

- Main Page
- Related Pages
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Related Functions
SUDimensionLinearRef Struct Reference

A linear dimension entity reference. More...

`#include <SketchUpAPI/model/dimension_linear.h>`

Inherits SUDimensionRef.

## Related Functions
(Note that these are not member functions.)
SUDimensionRef | SUDimensionLinearToDimension (SUDimensionLinearRef dimension)
| Converts from an SUDimensionLinearRef to an SUDimensionRef. This is essentially an upcast operation. More...
SUDimensionLinearRef | SUDimensionLinearFromDimension (SUDimensionRef dimension)
| Converts from an SUDimensionRef to an SUDimensionLinearRef. This is essentially a downcast operation so the given SUDimensionRef must be convertible to an SUDimensionLinearRef. More...
enum SUResult | SUDimensionLinearCreate (SUDimensionLinearRef *dimension, const struct SUPoint3D *start_point, SUInstancePathRef start_path, const struct SUPoint3D *end_point, SUInstancePathRef end_path, double offset)
| Creates a new linear dimension object with default data. Refer to the documentation for SUDimensionLinearSetStartPoint() for more information about the various supported ways for setting connection points. More...
enum SUResult | SUDimensionLinearRelease (SUDimensionLinearRef *dimension)
| Releases a dimension object. More...
enum SUResult | SUDimensionLinearGetStartPoint (SUDimensionLinearRef dimension, struct SUPoint3D *point, SUInstancePathRef *path)
| Retrieves the start point of a dimension object. The given instance path object either must have been constructed using one of the SUInstancePathCreate* functions or it will be generated on the fly if it is invalid. It must be released using SUInstancePathRelease() when it is no longer needed. More...
enum SUResult | SUDimensionLinearSetStartPoint (SUDimensionLinearRef dimension, const struct SUPoint3D *point, SUInstancePathRef path)
| Sets the start connection point of a dimension object. A dimension's connection point can be set in a few different ways. In the simplest form a connection point can be set to an arbitrary point in space by providing a non-null SUPoint3D and an invalid SUInstancePathRef. The more complex forms connect the point to a position on an entity in the model by providing a valid SUInstancePathRef which refers to an existing model entity. In the more complex forms the the input SUPoint3D must be non-null for all connectable entity types except for vertices and guide points, in which case the SUPoint3D argument may be null as it will be ignored. It should be noted that when changing a dimension's connection point the other point may need to be adjusted as well. Users may want to verify the other connection point after setting this one. More...
enum SUResult | SUDimensionLinearGetEndPoint (SUDimensionLinearRef dimension, struct SUPoint3D *point, SUInstancePathRef *path)
| Retrieves the end point of a dimension object. The given instance path object either must have been constructed using one of the SUInstancePathCreate* functions or it will be generated on the fly if it is invalid. It must be released using SUInstancePathRelease() when it is no longer needed. More...
enum SUResult | SUDimensionLinearSetEndPoint (SUDimensionLinearRef dimension, const struct SUPoint3D *point, SUInstancePathRef path)
| Sets the end connection point of a dimension object. Refer to the documentation for SUDimensionLinearSetStartPoint() for a detailed description on supported ways of setting a dimension's connection point. More...
enum SUResult | SUDimensionLinearGetXAxis (SUDimensionLinearRef dimension, struct SUVector3D *axis)
| Retrieves the x-axis of a dimension object. The x-axis is the axis along the length of the dimension. More...
enum SUResult | SUDimensionLinearSetXAxis (SUDimensionLinearRef dimension, const struct SUVector3D *axis)
| Sets the x-axis of a dimension object. More...
enum SUResult | SUDimensionLinearGetNormal (SUDimensionLinearRef dimension, struct SUVector3D *normal)
| Retrieves the normal vector of a dimension object. The normal vector is a unit vector pointing out of the plane of the linear dimension. A linear dimension's plane is the plane defined by the x-axis and the leader lines' direction vector. More...
enum SUResult | SUDimensionLinearSetNormal (SUDimensionLinearRef dimension, const struct SUVector3D *normal)
| Sets the normal vector of a dimension object. More...
enum SUResult | SUDimensionLinearGetPosition (SUDimensionLinearRef dimension, struct SUPoint2D *position)
| Retrieves the position of a dimension object. The position is a 2D point in the dimension's plane indicating where the dimension text is located. More...
enum SUResult | SUDimensionLinearSetPosition (SUDimensionLinearRef dimension, const struct SUPoint2D *position)
| Sets the position of a dimension object. More...
enum SUResult | SUDimensionLinearGetVerticalAlignment (SUDimensionLinearRef dimension, enum SUVerticalTextPositionType *alignment)
| Retrieves an enum value indicating the dimension's vertical alignment type. More...
enum SUResult | SUDimensionLinearSetVerticalAlignment (SUDimensionLinearRef dimension, enum SUVerticalTextPositionType alignment)
| Sets the dimension's vertical alignment type. More...
enum SUResult | SUDimensionLinearGetHorizontalAlignment (SUDimensionLinearRef dimension, enum SUHorizontalTextPositionType *alignment)
| Retrieves an enum value indicating the dimension's horizontal alignment type. More...
enum SUResult | SUDimensionLinearSetHorizontalAlignment (SUDimensionLinearRef dimension, enum SUHorizontalTextPositionType alignment)
| Sets the dimension's horizontal alignment type. More...
enum SUResult | SUDimensionLinearGetAlignment (SUDimensionLinearRef dimension, enum SUDimensionLinearAlignmentType *alignment)
| Retrieves an enum value indicating the linear dimension's alignment type. More...
enum SUResult | SUDimensionLinearGetTextPosition (SUDimensionLinearRef dimension, struct SUPoint3D *position)
| Retrieves the position of the text location attachment point of the dimension text. Note that depending on the TextPosition enumerator, this can be the center or side of a text element. More...
Related Functions inherited from SUDimensionRef
SUEntityRef | SUDimensionToEntity (SUDimensionRef dimension)
| Converts from an SUDimensionRef to an SUEntityRef. This is essentially an upcast operation. More...
SUDimensionRef | SUDimensionFromEntity (SUEntityRef entity)
| Converts from an SUEntityRef to an SUDimensionRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SUDimensionRef. More...
SUDrawingElementRef | SUDimensionToDrawingElement (SUDimensionRef dimension)
| Converts from an SUDimensionRef to an SUDrawingElementRef. This is essentially an upcast operation. More...
SUDimensionRef | SUDimensionFromDrawingElement (SUDrawingElementRef element)
| Converts from an SUDrawingElementRef to an SUDimensionRef. This is essentially a downcast operation so the given SUDrawingElementRef must be convertible to an SUDimensionRef. More...
enum SUResult | SUDimensionGetType (SUDimensionRef dimension, enum SUDimensionType *type)
| Retrieves an enum value indicating the dimension type (linear or radial). More...
enum SUResult | SUDimensionGetText (SUDimensionRef dimension, SUStringRef *text)
| Retrieves the text of a dimension object. More...
enum SUResult | SUDimensionSetText (SUDimensionRef dimension, const char *text)
| Sets the text of a dimension object. More...
enum SUResult | SUDimensionGetPlane (SUDimensionRef dimension, struct SUPlane3D *plane)
| Retrieves the plane of a dimension object. More...
enum SUResult | SUDimensionGetText3D (SUDimensionRef dimension, bool *is_text_3d)
| Retrieves a boolean indicating if the dimension text is 3D. More...
enum SUResult | SUDimensionSetText3D (SUDimensionRef dimension, bool is_text_3d)
| Sets a boolean indicating whether the dimension text is 3D. More...
enum SUResult | SUDimensionGetArrowType (SUDimensionRef dimension, enum SUArrowType *type)
| Retrieves an enum value indicating the dimension's arrow type. More...
enum SUResult | SUDimensionSetArrowType (SUDimensionRef dimension, enum SUArrowType type)
| Sets the dimension's arrow type. More...
enum SUResult | SUDimensionGetFont (SUDimensionRef dimension, SUFontRef *font)
| Get the dimension's font reference. More...
enum SUResult | SUDimensionSetFont (SUDimensionRef dimension, SUFontRef font)
| Sets the dimension's font from a font reference. More...
Related Functions inherited from SUDrawingElementRef
SUEntityRef | SUDrawingElementToEntity (SUDrawingElementRef elem)
| Converts from an SUDrawingElementRef to an SUEntityRef. This is essentially an upcast operation. More...
SUDrawingElementRef | SUDrawingElementFromEntity (SUEntityRef entity)
| Converts from an SUEntityRef to an SUDrawingElementRef. This is essentially a downcast operation so the given entity must be convertible to a drawing element. More...
enum SURefType | SUDrawingElementGetType (SUDrawingElementRef elem)
| Returns the concrete type of the given drawing element. More...
enum SUResult | SUDrawingElementGetBoundingBox (SUDrawingElementRef elem, struct SUBoundingBox3D *bbox)
| Retrieves the bounding box of a drawing element. More...
enum SUResult | SUDrawingElementGetMaterial (SUDrawingElementRef elem, SUMaterialRef *material)
| Retrieves the material object of a drawing element. More...
enum SUResult | SUDrawingElementSetMaterial (SUDrawingElementRef elem, SUMaterialRef material)
| Sets the material of a drawing element. More...
enum SUResult | SUDrawingElementGetLayer (SUDrawingElementRef elem, SULayerRef *layer)
| Retrieves the layer object associated with a drawing element. More...
enum SUResult | SUDrawingElementSetLayer (SUDrawingElementRef elem, SULayerRef layer)
| Sets the layer object to be associated with a drawing element. More...
enum SUResult | SUDrawingElementSetHidden (SUDrawingElementRef elem, bool hide_flag)
| Sets the hide flag of a drawing element. More...
enum SUResult | SUDrawingElementGetHidden (SUDrawingElementRef elem, bool *hide_flag)
| Retrieves the hide flag of a drawing element. More...
enum SUResult | SUDrawingElementSetCastsShadows (SUDrawingElementRef elem, bool casts_shadows_flag)
| Sets the casts shadows flag of a drawing element. More...
enum SUResult | SUDrawingElementGetCastsShadows (SUDrawingElementRef elem, bool *casts_shadows_flag)
| Retrieves the casts shadows flag of a drawing element. More...
enum SUResult | SUDrawingElementSetReceivesShadows (SUDrawingElementRef elem, bool receives_shadows_flag)
| Sets the receives shadows flag of a drawing element. More...
enum SUResult | SUDrawingElementGetReceivesShadows (SUDrawingElementRef elem, bool *receives_shadows_flag)
| Retrieves the receives shadows flag of a drawing element. More...
Related Functions inherited from SUEntityRef
enum SURefType | SUEntityGetType (SUEntityRef entity)
| Returns the concrete type of the given entity. More...
enum SUResult | SUEntityGetID (SUEntityRef entity, int32_t *entity_id)
| Retrieves the id of the entity. More...
enum SUResult | SUEntityGetPersistentID (SUEntityRef entity, int64_t *entity_pid)
| Retrieves the persistent id of the entity. More...
enum SUResult | SUEntityGetNumAttributeDictionaries (SUEntityRef entity, size_t *count)
| Retrieves the number of attribute dictionaries of an entity. More...
enum SUResult | SUEntityGetAttributeDictionaries (SUEntityRef entity, size_t len, SUAttributeDictionaryRef dictionaries[], size_t *count)
| Retrieves the attribute dictionaries of an entity. More...
enum SUResult | SUEntityAddAttributeDictionary (SUEntityRef entity, SUAttributeDictionaryRef dictionary)
| Adds the attribute dictionary to an entity. The given dictionary object must not belong to another entity. In other words, each dictionary should be added to one entity only. More...
enum SUResult | SUEntityGetAttributeDictionary (SUEntityRef entity, const char *name, SUAttributeDictionaryRef *dictionary)
| Retrieves the attribute dictionary of an entity that has the given name. More...
enum SUResult | SUEntityGetModel (SUEntityRef entity, SUModelRef *model)
| Retrieves the model object associated with the entity. More...
enum SUResult | SUEntityGetParentEntities (SUEntityRef entity, SUEntitiesRef *entities)
| Retrieves the entities object which contains the entity. More...

## Detailed Description

A linear dimension entity reference.

Since
  SketchUp 2017, API 5.0

## Friends And Related Function Documentation

enum SUResult SUDimensionLinearCreate | ( | SUDimensionLinearRef * | dimension,
|  | const struct SUPoint3D * | start_point,
|  | SUInstancePathRef | start_path,
|  | const struct SUPoint3D * | end_point,
|  | SUInstancePathRef | end_path,
|  | double | offset
| ) |  |
| related

Creates a new linear dimension object with default data. Refer to the documentation for SUDimensionLinearSetStartPoint() for more information about the various supported ways for setting connection points.

Since
  SketchUp 2017, API 5.0

Parameters

  [out] | dimension | The dimension object created.
  [in] | start_point | The 3d point used to set the start location.
  [in] | start_path | The instance path used to specify the entity connected to the dimension's start.
  [in] | end_point | The 3d point used to set the end location.
  [in] | end_path | The instance path used to specify the entity connected to the dimension's end.
  [in] | offset | The offset distance from the measured entities to be set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if dimension is NULL
  - SU_ERROR_OVERWRITE_VALID if dimension already references a valid object
  - SU_ERROR_NULL_POINTER_INPUT if {start,end}_path is invalid and {start,end}_point is NULL
  - SU_ERROR_INVALID_ARGUMENT {start,end}_path is valid but refers to an invalid instance path
  - SU_ERROR_GENERIC if {start,end}_point is NULL and {start,end}_path doesn't have a vertex or guide point for its leaf

Note
  If a valid path argument that points to an in model SUEntityRef is supplied then the dimension will automatically be added to the SUEntitiesRef that contains it. Otherwise a call to SUEntitiesAddDimension() will be required to add the newly created dimension to a model or component.

SUDimensionLinearRef SUDimensionLinearFromDimension | ( | SUDimensionRef | dimension | ) |
| related

Converts from an SUDimensionRef to an SUDimensionLinearRef. This is essentially a downcast operation so the given SUDimensionRef must be convertible to an SUDimensionLinearRef.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The given dimension reference.

Returns
  - The converted SUDimensionLinearRef if the downcast operation succeeds
  - If not, the returned reference will be invalid

enum SUResult SUDimensionLinearGetAlignment | ( | SUDimensionLinearRef | dimension,
|  | enum SUDimensionLinearAlignmentType * | alignment
| ) |  |
| related

Retrieves an enum value indicating the linear dimension's alignment type.

Since
  SketchUp 2019, API 7.0

Parameters

  [in] | dimension | The dimension object.
  [out] | alignment | The dimension alignment enum value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if alignment is NULL

enum SUResult SUDimensionLinearGetEndPoint | ( | SUDimensionLinearRef | dimension,
|  | struct SUPoint3D * | point,
|  | SUInstancePathRef * | path
| ) |  |
| related

Retrieves the end point of a dimension object. The given instance path object either must have been constructed using one of the SUInstancePathCreate* functions or it will be generated on the fly if it is invalid. It must be released using SUInstancePathRelease() when it is no longer needed.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.
  [out] | point | The 3d point retrieved.
  [out] | path | The instance path retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if point or path are NULL

enum SUResult SUDimensionLinearGetHorizontalAlignment | ( | SUDimensionLinearRef | dimension,
|  | enum SUHorizontalTextPositionType * | alignment
| ) |  |
| related

Retrieves an enum value indicating the dimension's horizontal alignment type.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.
  [out] | alignment | The dimension alignment enum value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if alignment is NULL

enum SUResult SUDimensionLinearGetNormal | ( | SUDimensionLinearRef | dimension,
|  | struct SUVector3D * | normal
| ) |  |
| related

Retrieves the normal vector of a dimension object. The normal vector is a unit vector pointing out of the plane of the linear dimension. A linear dimension's plane is the plane defined by the x-axis and the leader lines' direction vector.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.
  [out] | normal | The 3d vector retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if normal is NULL

enum SUResult SUDimensionLinearGetPosition | ( | SUDimensionLinearRef | dimension,
|  | struct SUPoint2D * | position
| ) |  |
| related

Retrieves the position of a dimension object. The position is a 2D point in the dimension's plane indicating where the dimension text is located.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.
  [out] | position | The position retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if position is NULL

enum SUResult SUDimensionLinearGetStartPoint | ( | SUDimensionLinearRef | dimension,
|  | struct SUPoint3D * | point,
|  | SUInstancePathRef * | path
| ) |  |
| related

Retrieves the start point of a dimension object. The given instance path object either must have been constructed using one of the SUInstancePathCreate* functions or it will be generated on the fly if it is invalid. It must be released using SUInstancePathRelease() when it is no longer needed.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.
  [out] | point | The 3d point retrieved.
  [out] | path | The instance path retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if point or path are NULL

enum SUResult SUDimensionLinearGetTextPosition | ( | SUDimensionLinearRef | dimension,
|  | struct SUPoint3D * | position
| ) |  |
| related

Retrieves the position of the text location attachment point of the dimension text. Note that depending on the TextPosition enumerator, this can be the center or side of a text element.

Since
  SketchUp 2019, API 7.0

Parameters

  [in] | dimension | The dimension object.
  [out] | position | The position of the text element.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_OUT_OF_RANGE if the dimension text relation is invalid
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if position is NULL

enum SUResult SUDimensionLinearGetVerticalAlignment | ( | SUDimensionLinearRef | dimension,
|  | enum SUVerticalTextPositionType * | alignment
| ) |  |
| related

Retrieves an enum value indicating the dimension's vertical alignment type.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.
  [out] | alignment | The dimension alignment enum value retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if alignment is NULL

enum SUResult SUDimensionLinearGetXAxis | ( | SUDimensionLinearRef | dimension,
|  | struct SUVector3D * | axis
| ) |  |
| related

Retrieves the x-axis of a dimension object. The x-axis is the axis along the length of the dimension.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.
  [out] | axis | The 3d vector retrieved.

Returns
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if path is invalid and point is NULL
  - SU_ERROR_INVALID_INPUT if point is not NULL and path refers to an invalid instance path
  - SU_ERROR_GENERIC if point is NULL and path doesn't have a vertex or guide point for its leaf

enum SUResult SUDimensionLinearRelease | ( | SUDimensionLinearRef * | dimension | ) |
| related

Releases a dimension object.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is an invalid object
  - SU_ERROR_NULL_POINTER_INPUT if dimension is NULL

enum SUResult SUDimensionLinearSetEndPoint | ( | SUDimensionLinearRef | dimension,
|  | const struct SUPoint3D * | point,
|  | SUInstancePathRef | path
| ) |  |
| related

Sets the end connection point of a dimension object. Refer to the documentation for SUDimensionLinearSetStartPoint() for a detailed description on supported ways of setting a dimension's connection point.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.
  [in] | point | The 3d point to be set.
  [in] | path | The instance path to be set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if path is invalid and point is NULL
  - SU_ERROR_INVALID_ARGUMENT path is valid but refers to an invalid instance path
  - SU_ERROR_GENERIC if point is NULL and path doesn't have a vertex or guide point for its leaf

enum SUResult SUDimensionLinearSetHorizontalAlignment | ( | SUDimensionLinearRef | dimension,
|  | enum SUHorizontalTextPositionType | alignment
| ) |  |
| related

Sets the dimension's horizontal alignment type.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.
  [in] | alignment | The dimension alignment type to be set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object

enum SUResult SUDimensionLinearSetNormal | ( | SUDimensionLinearRef | dimension,
|  | const struct SUVector3D * | normal
| ) |  |
| related

Sets the normal vector of a dimension object.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.
  [in] | normal | The 3d vector to be set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if normal is NULL

enum SUResult SUDimensionLinearSetPosition | ( | SUDimensionLinearRef | dimension,
|  | const struct SUPoint2D * | position
| ) |  |
| related

Sets the position of a dimension object.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.
  [in] | position | The position to be set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if position is NULL

enum SUResult SUDimensionLinearSetStartPoint | ( | SUDimensionLinearRef | dimension,
|  | const struct SUPoint3D * | point,
|  | SUInstancePathRef | path
| ) |  |
| related

Sets the start connection point of a dimension object. A dimension's connection point can be set in a few different ways. In the simplest form a connection point can be set to an arbitrary point in space by providing a non-null SUPoint3D and an invalid SUInstancePathRef. The more complex forms connect the point to a position on an entity in the model by providing a valid SUInstancePathRef which refers to an existing model entity. In the more complex forms the the input SUPoint3D must be non-null for all connectable entity types except for vertices and guide points, in which case the SUPoint3D argument may be null as it will be ignored. It should be noted that when changing a dimension's connection point the other point may need to be adjusted as well. Users may want to verify the other connection point after setting this one.

Since
  SketchUp 2017, API 5.0

// Simple Example: Connect to an arbitrary position in space
SUPoint3D point{ xposition, yposition, zposition};
SUDimensionLinearSetStartPoint(dimension, &point, SU_INVALID);
// Vertex Example: Connect to vertex entity
SUInstancePathRef path = SU_INVALID;
SUInstancePathCreate(&path);
SUInstancePathSetLeaf(path, SUVertexToEntity(vertex));
SUDimensionLinearSetStartPoint(dimension, NULL, path);
// Edge Example: Connect to nearest point on an instance of an edge entity
SUPoint3D point{ xposition, yposition, zposition};
SUInstancePathRef path = SU_INVALID;
SUInstancePathCreate(&path);
SUInstancePathPushInstance(path, instance);
SUInstancePathSetLeaf(path, SUEdgeToEntity(edge));
SUDimensionLinearSetStartPoint(dimension, &point, path);

Parameters

  [in] | dimension | The dimension object.
  [in] | point | The 3d point to be set.
  [in] | path | The instance path to be set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if path is invalid and point is NULL
  - SU_ERROR_INVALID_ARGUMENT path is valid but refers to an invalid instance path
  - SU_ERROR_GENERIC if point is NULL and path doesn't have a vertex or guide point for its leaf

enum SUResult SUDimensionLinearSetVerticalAlignment | ( | SUDimensionLinearRef | dimension,
|  | enum SUVerticalTextPositionType | alignment
| ) |  |
| related

Sets the dimension's vertical alignment type.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.
  [in] | alignment | The dimension alignment type to be set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object

enum SUResult SUDimensionLinearSetXAxis | ( | SUDimensionLinearRef | dimension,
|  | const struct SUVector3D * | axis
| ) |  |
| related

Sets the x-axis of a dimension object.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The dimension object.
  [in] | axis | The 3d vector to be set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if dimension is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if axis is NULL

SUDimensionRef SUDimensionLinearToDimension | ( | SUDimensionLinearRef | dimension | ) |
| related

Converts from an SUDimensionLinearRef to an SUDimensionRef. This is essentially an upcast operation.

Since
  SketchUp 2017, API 5.0

Parameters

  [in] | dimension | The given dimension reference.

Returns
  - The converted SUDimensionRef if dimension is a valid object
  - If not, the returned reference will be invalid

The documentation for this struct was generated from the following files:

- SketchUpAPI/model/defs.h
- SketchUpAPI/model/dimension_linear.h