SketchUp C API
 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...
 

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]dimensionThe dimension object created.
[in]start_pointThe 3d point used to set the start location.
[in]start_pathThe instance path used to specify the entity connected to the dimension's start.
[in]end_pointThe 3d point used to set the end location.
[in]end_pathThe instance path used to specify the entity connected to the dimension's end.
[in]offsetThe offset distance from the measured entities to be set.
Returns
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]dimensionThe 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]dimensionThe dimension object.
[out]alignmentThe dimension alignment enum value retrieved.
Returns
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]dimensionThe dimension object.
[out]pointThe 3d point retrieved.
[out]pathThe instance path retrieved.
Returns
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]dimensionThe dimension object.
[out]alignmentThe dimension alignment enum value retrieved.
Returns
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]dimensionThe dimension object.
[out]normalThe 3d vector retrieved.
Returns
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]dimensionThe dimension object.
[out]positionThe position retrieved.
Returns
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]dimensionThe dimension object.
[out]pointThe 3d point retrieved.
[out]pathThe instance path retrieved.
Returns
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]dimensionThe dimension object.
[out]positionThe position of the text element.
Returns
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]dimensionThe dimension object.
[out]alignmentThe dimension alignment enum value retrieved.
Returns
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]dimensionThe dimension object.
[out]axisThe 3d vector retrieved.
Returns
enum SUResult SUDimensionLinearRelease ( SUDimensionLinearRef dimension)
related

Releases a dimension object.

Since
SketchUp 2017, API 5.0
Parameters
[in]dimensionThe dimension object.
Returns
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]dimensionThe dimension object.
[in]pointThe 3d point to be set.
[in]pathThe instance path to be set.
Returns
enum SUResult SUDimensionLinearSetHorizontalAlignment ( SUDimensionLinearRef  dimension,
enum SUHorizontalTextPositionType  alignment 
)
related

Sets the dimension's horizontal alignment type.

Since
SketchUp 2017, API 5.0
Parameters
[in]dimensionThe dimension object.
[in]alignmentThe dimension alignment type to be set.
Returns
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]dimensionThe dimension object.
[in]normalThe 3d vector to be set.
Returns
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]dimensionThe dimension object.
[in]positionThe position to be set.
Returns
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};
// Vertex Example: Connect to vertex entity
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};
SUInstancePathCreate(&path);
SUInstancePathPushInstance(path, instance);
SUInstancePathSetLeaf(path, SUEdgeToEntity(edge));
SUDimensionLinearSetStartPoint(dimension, &point, path);
Parameters
[in]dimensionThe dimension object.
[in]pointThe 3d point to be set.
[in]pathThe instance path to be set.
Returns
enum SUResult SUDimensionLinearSetVerticalAlignment ( SUDimensionLinearRef  dimension,
enum SUVerticalTextPositionType  alignment 
)
related

Sets the dimension's vertical alignment type.

Since
SketchUp 2017, API 5.0
Parameters
[in]dimensionThe dimension object.
[in]alignmentThe dimension alignment type to be set.
Returns
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]dimensionThe dimension object.
[in]axisThe 3d vector to be set.
Returns
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]dimensionThe 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: