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
SUCurveRef Struct Reference

References a curve. More...

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

Inherits SUEntityRef.

Inherited by SUArcCurveRef.

## Related Functions
(Note that these are not member functions.)
SUEntityRef | SUCurveToEntity (SUCurveRef curve)
| Converts from an SUCurveRef to an SUEntityRef. This is essentially an upcast operation. More...
SUCurveRef | SUCurveFromEntity (SUEntityRef entity)
| Converts from an SUEntityRef to an SUCurveRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SUCurveRef. More...
enum SUResult | SUCurveCreateWithEdges (SUCurveRef *curve, const SUEdgeRef edges[], size_t len)
| Creates a curve object with the given array of edges that is not connected to any face object. The array of N edges is sorted such that for each edge in the range [0, N] the start position of each edge is the same as the end position of the previous edge in the array. Each element of the array of edges is subsequently associated with the created curve object and must not be deallocated via SUEdgeRelease(). More...
enum SUResult | SUCurveRelease (SUCurveRef *curve)
| Releases a curve object and its associated edge objects. More...
enum SUResult | SUCurveGetType (SUCurveRef curve, enum SUCurveType *type)
| Retrieves the curve type of a curve object. More...
enum SUResult | SUCurveGetNumEdges (SUCurveRef curve, size_t *count)
| Retrieves the number of edges that belong to a curve object. More...
enum SUResult | SUCurveGetEdges (SUCurveRef curve, size_t len, SUEdgeRef edges[], size_t *count)
| Retrieves the edges of a curve object. Provides access to all edges in the curve. The first edge is the first element of the edges array and the last edge is the last element if all edges were retrieved. More...
enum SUResult | SUCurveIsPolygon (SUCurveRef curve, bool *is_curve)
| True if this edge was originally created by the polygon tool, otherwise false. 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

References a curve.

## Friends And Related Function Documentation

enum SUResult SUCurveCreateWithEdges | ( | SUCurveRef * | curve,
|  | const SUEdgeRef | edges[],
|  | size_t | len
| ) |  |
| related

Creates a curve object with the given array of edges that is not connected to any face object. The array of N edges is sorted such that for each edge in the range [0, N] the start position of each edge is the same as the end position of the previous edge in the array. Each element of the array of edges is subsequently associated with the created curve object and must not be deallocated via SUEdgeRelease().

Parameters

  [out] | curve | The curve object created.
  [in] | edges | The array of edge objects.
  [in] | len | The number of edge objects in the array.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if edges is NULL
  - SU_ERROR_OUT_OF_RANGE if len is 0
  - SU_ERROR_NULL_POINTER_OUTPUT if curve is NULL
  - SU_ERROR_OVERWRITE_VALID if curve already references a valid object
  - SU_ERROR_GENERIC if edge array contains an invalid edge, if the edges in the array are not connected, if any of the edges are associated with a face object, or the edges describe a loop

SUCurveRef SUCurveFromEntity | ( | SUEntityRef | entity | ) |
| related

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

Parameters

  [in] | entity | The given entity reference.

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

enum SUResult SUCurveGetEdges | ( | SUCurveRef | curve,
|  | size_t | len,
|  | SUEdgeRef | edges[],
|  | size_t * | count
| ) |  |
| related

Retrieves the edges of a curve object. Provides access to all edges in the curve. The first edge is the first element of the edges array and the last edge is the last element if all edges were retrieved.

Parameters

  [in] | curve | The curve object.
  [in] | len | The number of edges to retrieve.
  [out] | edges | The edges retrieved.
  [out] | count | The number of edges retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if curve is not a valid curve object
  - SU_ERROR_NULL_POINTER_OUTPUT if edges or count is NULL

enum SUResult SUCurveGetNumEdges | ( | SUCurveRef | curve,
|  | size_t * | count
| ) |  |
| related

Retrieves the number of edges that belong to a curve object.

Parameters

  [in] | curve | The curve object.
  [out] | count | The number of edges.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if curve is not a valid curve object
  - SU_ERROR_NULL_POINTER_OUTPUT if count is NULL

enum SUResult SUCurveGetType | ( | SUCurveRef | curve,
|  | enum SUCurveType * | type
| ) |  |
| related

Retrieves the curve type of a curve object.

Parameters

  [in] | curve | The curve object.
  [out] | type | The curve type retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if curve is not a valid curve object
  - SU_ERROR_NULL_POINTER_OUTPUT if type is NULL

enum SUResult SUCurveIsPolygon | ( | SUCurveRef | curve,
|  | bool * | is_curve
| ) |  |
| related

True if this edge was originally created by the polygon tool, otherwise false.

Since
  SketchUp 2021.1, API 9.1

Parameters

  [in] | curve |
  [out] | is_curve | The edges retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `curve` is not a valid curve object
  - SU_ERROR_NULL_POINTER_OUTPUT if `is_curve` is NULL

enum SUResult SUCurveRelease | ( | SUCurveRef * | curve | ) |
| related

Releases a curve object and its associated edge objects.

Parameters

  [in,out] | curve | The curve object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if curve is NULL
  - SU_ERROR_INVALID_INPUT if curve does not reference a valid object

SUEntityRef SUCurveToEntity | ( | SUCurveRef | curve | ) |
| related

Converts from an SUCurveRef to an SUEntityRef. This is essentially an upcast operation.

Parameters

  [in] | curve | The given curve reference.

Returns
  - The converted SUEntityRef if curve 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/curve.h