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

References an edge. More...

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

Inherits SUDrawingElementRef.

## Related Functions
(Note that these are not member functions.)
SUEntityRef | SUEdgeToEntity (SUEdgeRef edge)
| Converts from an SUEdgeRef to an SUEntityRef. This is essentially an upcast operation. More...
SUEdgeRef | SUEdgeFromEntity (SUEntityRef entity)
| Converts from an SUEntityRef to an SUEdgeRef. This is essentially a downcast operation so the given entity must be convertible to an SUEdgeRef. More...
SUDrawingElementRef | SUEdgeToDrawingElement (SUEdgeRef edge)
| Converts from an SUEdgeRef to an SUDrawingElementRef. This is essentially an upcast operation. More...
SUEdgeRef | SUEdgeFromDrawingElement (SUDrawingElementRef drawing_elem)
| Converts from an SUDrawingElementRef to an SUEdgeRef. This is essentially a downcast operation so the given element must be convertible to an SUEdgeRef. More...
enum SUResult | SUEdgeCreate (SUEdgeRef *edge, const struct SUPoint3D *start, const struct SUPoint3D *end)
| Creates a new edge object. More...
enum SUResult | SUEdgeRelease (SUEdgeRef *edge)
| Releases an edge object. More...
enum SUResult | SUEdgeGetCurve (SUEdgeRef edge, SUCurveRef *curve)
| Retrieves the associated curve object of an edge object. More...
enum SUResult | SUEdgeGetStartVertex (SUEdgeRef edge, SUVertexRef *vertex)
| Retrieves the starting vertex of an edge object. More...
enum SUResult | SUEdgeGetEndVertex (SUEdgeRef edge, SUVertexRef *vertex)
| Retrieves the end vertex of an edge object. More...
enum SUResult | SUEdgeSetSoft (SUEdgeRef edge, bool soft_flag)
| Sets the soft flag of an edge object. More...
enum SUResult | SUEdgeGetSoft (SUEdgeRef edge, bool *soft_flag)
| Retrieves the soft flag of an edge object. More...
enum SUResult | SUEdgeSetSmooth (SUEdgeRef edge, bool smooth_flag)
| Sets the smooth flag of an edge object. More...
enum SUResult | SUEdgeGetSmooth (SUEdgeRef edge, bool *smooth_flag)
| Retrieves the smooth flag of an edge object. More...
enum SUResult | SUEdgeGetNumFaces (SUEdgeRef edge, size_t *count)
| Retrieves the number of faces that the edge is associated with. More...
enum SUResult | SUEdgeGetFaces (SUEdgeRef edge, size_t len, SUFaceRef faces[], size_t *count)
| Retrieves the face objects associated with an edge object. More...
enum SUResult | SUEdgeGetColor (SUEdgeRef edge, SUColor *color)
| Retrieves the color of an edge object. More...
enum SUResult | SUEdgeGetLengthWithTransform (SUEdgeRef edge, const struct SUTransformation *transform, double *length)
| Computes the length of the edge with the provided transformation applied. More...
enum SUResult | SUEdgeSetColor (SUEdgeRef edge, const SUColor *color)
| Sets the color of an edge object. More...
enum SUResult | SUEdgeReversedInFace (SUEdgeRef edge, SUFaceRef face, bool *reversed)
| Determine if `edge` is reversed in `face` 's bounding loop. 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

References an edge.

## Friends And Related Function Documentation

enum SUResult SUEdgeCreate | ( | SUEdgeRef * | edge,
|  | const struct SUPoint3D * | start,
|  | const struct SUPoint3D * | end
| ) |  |
| related

Creates a new edge object.

The edge object must be subsequently deallocated with SUEdgeRelease() unless the edge object is associated with a parent object.

Parameters

  [out] | edge | The edge object.
  [in] | start | The start position of the edge object.
  [in] | end | The end position of the edge object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if start or end is NULL
  - SU_ERROR_NULL_POINTER_OUTPUT if edge is NULL
  - SU_ERROR_GENERIC if start and end specify the same position.

SUEdgeRef SUEdgeFromDrawingElement | ( | SUDrawingElementRef | drawing_elem | ) |
| related

Converts from an SUDrawingElementRef to an SUEdgeRef. This is essentially a downcast operation so the given element must be convertible to an SUEdgeRef.

Parameters

  [in] | drawing_elem | The given element reference.

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

SUEdgeRef SUEdgeFromEntity | ( | SUEntityRef | entity | ) |
| related

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

Parameters

  [in] | entity | The given entity reference.

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

enum SUResult SUEdgeGetColor | ( | SUEdgeRef | edge,
|  | SUColor * | color
| ) |  |
| related

Retrieves the color of an edge object.

Parameters

  [in] | edge | The edge object.
  [out] | color | The color retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if edge is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if color is NULL

enum SUResult SUEdgeGetCurve | ( | SUEdgeRef | edge,
|  | SUCurveRef * | curve
| ) |  |
| related

Retrieves the associated curve object of an edge object.

Parameters

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

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if curve is NULL
  - SU_ERROR_NO_DATA if the edge object is not associated with a curve object.

enum SUResult SUEdgeGetEndVertex | ( | SUEdgeRef | edge,
|  | SUVertexRef * | vertex
| ) |  |
| related

Retrieves the end vertex of an edge object.

Parameters

  [in] | edge | The edge object.
  [out] | vertex | The vertex object retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if edge is an invalid object
  - SU_ERROR_NULL_POINTER_OUTPUT if vertex is NULL

enum SUResult SUEdgeGetFaces | ( | SUEdgeRef | edge,
|  | size_t | len,
|  | SUFaceRef | faces[],
|  | size_t * | count
| ) |  |
| related

Retrieves the face objects associated with an edge object.

Parameters

  [in] | edge | The edge object.
  [in] | len | The number of faces to retrieve.
  [out] | faces | The faces retrieved.
  [out] | count | The number of face objects retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if edge is an invalid object
  - SU_ERROR_NULL_POINTER_OUTPUT if faces or count is NULL

enum SUResult SUEdgeGetLengthWithTransform | ( | SUEdgeRef | edge,
|  | const struct SUTransformation * | transform,
|  | double * | length
| ) |  |
| related

Computes the length of the edge with the provided transformation applied.

Parameters

  [in] | edge | The edge object.
  [in] | transform | A transformation to be appllied to the edge.
  [out] | length | The length retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if edge is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if color is NULL

enum SUResult SUEdgeGetNumFaces | ( | SUEdgeRef | edge,
|  | size_t * | count
| ) |  |
| related

Retrieves the number of faces that the edge is associated with.

Parameters

  [in] | edge | The edge object.
  [out] | count | The number of faces.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if edge is an invalid object
  - SU_ERROR_NULL_POINTER_OUTPUT if count is NULL

enum SUResult SUEdgeGetSmooth | ( | SUEdgeRef | edge,
|  | bool * | smooth_flag
| ) |  |
| related

Retrieves the smooth flag of an edge object.

Parameters

  [in] | edge | The edge object.
  [out] | smooth_flag | The smooth flag retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if edge is an invalid object
  - SU_ERROR_NULL_POINTER_OUTPUT if smooth_flag is NULL

enum SUResult SUEdgeGetSoft | ( | SUEdgeRef | edge,
|  | bool * | soft_flag
| ) |  |
| related

Retrieves the soft flag of an edge object.

Parameters

  [in] | edge | The edge object.
  [out] | soft_flag | The soft flag retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if edge is an invalid object.
  - SU_ERROR_NULL_POINTER_OUTPUT if soft_flag is NULL

enum SUResult SUEdgeGetStartVertex | ( | SUEdgeRef | edge,
|  | SUVertexRef * | vertex
| ) |  |
| related

Retrieves the starting vertex of an edge object.

Parameters

  [in] | edge | The edge object.
  [out] | vertex | The vertex object retrieved.

Returns
  - SU_ERROR_NONE on success.
  - SU_ERROR_INVALID_INPUT if edge is an invalid edge object
  - SU_ERROR_NULL_POINTER_OUTPUT if vertex is NULL.

enum SUResult SUEdgeRelease | ( | SUEdgeRef * | edge | ) |
| related

Releases an edge object.

The edge object must have been created with SUEdgeCreate() and not subsequently associated with a parent object (e.g. SUEntitiesAddEdges()).

Parameters

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

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

enum SUResult SUEdgeReversedInFace | ( | SUEdgeRef | edge,
|  | SUFaceRef | face,
|  | bool * | reversed
| ) |  |
| related

Determine if `edge` is reversed in `face` 's bounding loop.

Since
  SketchUp 2021.1, API 9.1

Parameters

  [in] | edge | The edge object.
  [in] | face | The face object.
  [out] | reversed | The reverse status retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `edge` is an invalid object.
  - SU_ERROR_INVALID_INPUT if `face` is an invalid object.
  - SU_ERROR_NULL_POINTER_OUTPUT if `reversed` is null.
  - SU_ERROR_INVALID_ARGUMENT if `edge` is not bounding `face`.

enum SUResult SUEdgeSetColor | ( | SUEdgeRef | edge,
|  | const SUColor * | color
| ) |  |
| related

Sets the color of an edge object.

Parameters

  [in,out] | edge | The edge object.
  [in] | color | The color object to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if edge is an invalid object.
  - SU_ERROR_NULL_POINTER_INPUT if color is NULL.

enum SUResult SUEdgeSetSmooth | ( | SUEdgeRef | edge,
|  | bool | smooth_flag
| ) |  |
| related

Sets the smooth flag of an edge object.

Parameters

  [in,out] | edge | The edge object.
  [in] | smooth_flag | The smooth flag to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if edge is an invalid object

enum SUResult SUEdgeSetSoft | ( | SUEdgeRef | edge,
|  | bool | soft_flag
| ) |  |
| related

Sets the soft flag of an edge object.

Parameters

  [in,out] | edge | The edge object.
  [in] | soft_flag | The soft flag to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if edge is an invalid object

SUDrawingElementRef SUEdgeToDrawingElement | ( | SUEdgeRef | edge | ) |
| related

Converts from an SUEdgeRef to an SUDrawingElementRef. This is essentially an upcast operation.

Parameters

  [in] | edge | The given edge reference.

Returns
  - The converted SUEntityRef if edge is a valid edge
  - If not, the returned reference will be invalid

SUEntityRef SUEdgeToEntity | ( | SUEdgeRef | edge | ) |
| related

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

Parameters

  [in] | edge | The given edge reference.

Returns
  - The converted SUEntityRef if edge is a valid edge
  - 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/edge.h