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

References a drawing element, which is an abstract base type for some API types. More...

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

Inherits SUEntityRef.

Inherited by SUComponentInstanceRef, SUDimensionRef, SUEdgeRef, SUFaceRef, SUGuideLineRef, SUGuidePointRef, SUImageRef, SUSectionPlaneRef, SUSnapRef, and SUTextRef.

## Related Functions
(Note that these are not member functions.)
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 a drawing element, which is an abstract base type for some API types.

## Friends And Related Function Documentation

SUDrawingElementRef SUDrawingElementFromEntity | ( | SUEntityRef | entity | ) |
| related

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

Parameters

  [in] | entity | The given entity reference.

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

enum SUResult SUDrawingElementGetBoundingBox | ( | SUDrawingElementRef | elem,
|  | struct SUBoundingBox3D * | bbox
| ) |  |
| related

Retrieves the bounding box of a drawing element.

Parameters

  [in] | elem | The drawing element.
  [out] | bbox | The bounding box retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if elem is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if bbox is NULL

enum SUResult SUDrawingElementGetCastsShadows | ( | SUDrawingElementRef | elem,
|  | bool * | casts_shadows_flag
| ) |  |
| related

Retrieves the casts shadows flag of a drawing element.

Parameters

  [in] | elem | The drawing element.
  [out] | casts_shadows_flag | The casts shadows flag retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if elem is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if hide_flag is NULL

enum SUResult SUDrawingElementGetHidden | ( | SUDrawingElementRef | elem,
|  | bool * | hide_flag
| ) |  |
| related

Retrieves the hide flag of a drawing element.

Parameters

  [in] | elem | The drawing element.
  [out] | hide_flag | The hide flag retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if elem is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if hide_flag is NULL

enum SUResult SUDrawingElementGetLayer | ( | SUDrawingElementRef | elem,
|  | SULayerRef * | layer
| ) |  |
| related

Retrieves the layer object associated with a drawing element.

Parameters

  [in] | elem | The drawing element.
  [out] | layer | The layer object retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if elem is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if layer is NULL

enum SUResult SUDrawingElementGetMaterial | ( | SUDrawingElementRef | elem,
|  | SUMaterialRef * | material
| ) |  |
| related

Retrieves the material object of a drawing element.

The material object must not be subsequently deallocated while still associated with the drawing element.

Parameters

  [in] | elem | The drawing element.
  [out] | material | The drawing element retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if elem is an invalid object
  - SU_ERROR_NULL_POINTER_OUTPUT if material is NULL
  - SU_ERROR_NO_DATA if the drawing element does not have a front face material

enum SUResult SUDrawingElementGetReceivesShadows | ( | SUDrawingElementRef | elem,
|  | bool * | receives_shadows_flag
| ) |  |
| related

Retrieves the receives shadows flag of a drawing element.

Parameters

  [in] | elem | The drawing element.
  [out] | receives_shadows_flag | The casts shadows flag retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if elem is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if hide_flag is NULL

enum SURefType SUDrawingElementGetType | ( | SUDrawingElementRef | elem | ) |
| related

Returns the concrete type of the given drawing element.

Parameters

  [in] | elem | The drawing element.

Returns
  - The concrete type of the given drawing element reference.
  - SURefType_Unknown if entity is not a valid drawing element.

enum SUResult SUDrawingElementSetCastsShadows | ( | SUDrawingElementRef | elem,
|  | bool | casts_shadows_flag
| ) |  |
| related

Sets the casts shadows flag of a drawing element.

Parameters

  [in,out] | elem | The drawing element.
  [in] | casts_shadows_flag | The casts shadows flag to set.

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

enum SUResult SUDrawingElementSetHidden | ( | SUDrawingElementRef | elem,
|  | bool | hide_flag
| ) |  |
| related

Sets the hide flag of a drawing element.

Parameters

  [in,out] | elem | The drawing element.
  [in] | hide_flag | The hide flag to set.

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

enum SUResult SUDrawingElementSetLayer | ( | SUDrawingElementRef | elem,
|  | SULayerRef | layer
| ) |  |
| related

Sets the layer object to be associated with a drawing element.

Parameters

  [in,out] | elem | The drawing element.
  [in] | layer | The layer object to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if elem or layer are invalid objects

enum SUResult SUDrawingElementSetMaterial | ( | SUDrawingElementRef | elem,
|  | SUMaterialRef | material
| ) |  |
| related

Sets the material of a drawing element.

The material object must not be subsequently deallocated while associated with the drawing element.

Parameters

  [in,out] | elem | The drawing element.
  [in] | material | The material object to set. If an invalid reference is given, then the material of the element will be removed.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if elem is invalid
  - SU_ERROR_INVALID_ARGUMENT is the material is owned by a layer or image

enum SUResult SUDrawingElementSetReceivesShadows | ( | SUDrawingElementRef | elem,
|  | bool | receives_shadows_flag
| ) |  |
| related

Sets the receives shadows flag of a drawing element.

Parameters

  [in,out] | elem | The drawing element.
  [in] | receives_shadows_flag | The casts shadows flag to set.

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

SUEntityRef SUDrawingElementToEntity | ( | SUDrawingElementRef | elem | ) |
| related

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

Parameters

  [in] | elem | The given drawing element reference.

Returns
  - The converted SUEntityRef if elem is a valid drawing element.
  - 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/drawing_element.h