SketchUp C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
drawing_element.h File Reference
#include <SketchUpAPI/common.h>
#include <SketchUpAPI/model/defs.h>

Go to the source code of this file.

Functions

SU_EXPORT SUEntityRef SUDrawingElementToEntity (SUDrawingElementRef elem)
 Converts from an SUDrawingElementRef to an SUEntityRef. This is essentially an upcast operation. More...
 
SU_EXPORT 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...
 
SU_EXPORT enum SURefType SUDrawingElementGetType (SUDrawingElementRef elem)
 Returns the concrete type of the given drawing element. More...
 
SU_RESULT SUDrawingElementGetBoundingBox (SUDrawingElementRef elem, struct SUBoundingBox3D *bbox)
 Retrieves the bounding box of a drawing element. More...
 
SU_RESULT SUDrawingElementGetMaterial (SUDrawingElementRef elem, SUMaterialRef *material)
 Retrieves the material object of a drawing element. More...
 
SU_RESULT SUDrawingElementSetMaterial (SUDrawingElementRef elem, SUMaterialRef material)
 Sets the material of a drawing element. More...
 
SU_RESULT SUDrawingElementGetLayer (SUDrawingElementRef elem, SULayerRef *layer)
 Retrieves the layer object associated with a drawing element. More...
 
SU_RESULT SUDrawingElementSetLayer (SUDrawingElementRef elem, SULayerRef layer)
 Sets the layer object to be associated with a drawing element. More...
 
SU_RESULT SUDrawingElementSetHidden (SUDrawingElementRef elem, bool hide_flag)
 Sets the hide flag of a drawing element. More...
 
SU_RESULT SUDrawingElementGetHidden (SUDrawingElementRef elem, bool *hide_flag)
 Retrieves the hide flag of a drawing element. More...
 
SU_RESULT SUDrawingElementSetCastsShadows (SUDrawingElementRef elem, bool casts_shadows_flag)
 Sets the casts shadows flag of a drawing element. More...
 
SU_RESULT SUDrawingElementGetCastsShadows (SUDrawingElementRef elem, bool *casts_shadows_flag)
 Retrieves the casts shadows flag of a drawing element. More...
 
SU_RESULT SUDrawingElementSetReceivesShadows (SUDrawingElementRef elem, bool receives_shadows_flag)
 Sets the receives shadows flag of a drawing element. More...
 
SU_RESULT SUDrawingElementGetReceivesShadows (SUDrawingElementRef elem, bool *receives_shadows_flag)
 Retrieves the receives shadows flag of a drawing element. More...
 

Function Documentation

SU_EXPORT 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.

Parameters
[in]entityThe given entity reference.
Returns
  • The converted SUDrawingElementRef if the downcast operation succeeds.
  • If not, the returned reference will be invalid.
SU_RESULT SUDrawingElementGetBoundingBox ( SUDrawingElementRef  elem,
struct SUBoundingBox3D bbox 
)

Retrieves the bounding box of a drawing element.

Parameters
[in]elemThe drawing element.
[out]bboxThe bounding box retrieved.
Returns
SU_RESULT SUDrawingElementGetCastsShadows ( SUDrawingElementRef  elem,
bool *  casts_shadows_flag 
)

Retrieves the casts shadows flag of a drawing element.

Parameters
[in]elemThe drawing element.
[out]casts_shadows_flagThe casts shadows flag retrieved.
Returns
SU_RESULT SUDrawingElementGetHidden ( SUDrawingElementRef  elem,
bool *  hide_flag 
)

Retrieves the hide flag of a drawing element.

Parameters
[in]elemThe drawing element.
[out]hide_flagThe hide flag retrieved.
Returns
SU_RESULT SUDrawingElementGetLayer ( SUDrawingElementRef  elem,
SULayerRef layer 
)

Retrieves the layer object associated with a drawing element.

Parameters
[in]elemThe drawing element.
[out]layerThe layer object retrieved.
Returns
SU_RESULT SUDrawingElementGetMaterial ( SUDrawingElementRef  elem,
SUMaterialRef material 
)

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]elemThe drawing element.
[out]materialThe drawing element retrieved.
Returns
SU_RESULT SUDrawingElementGetReceivesShadows ( SUDrawingElementRef  elem,
bool *  receives_shadows_flag 
)

Retrieves the receives shadows flag of a drawing element.

Parameters
[in]elemThe drawing element.
[out]receives_shadows_flagThe casts shadows flag retrieved.
Returns
SU_EXPORT enum SURefType SUDrawingElementGetType ( SUDrawingElementRef  elem)

Returns the concrete type of the given drawing element.

Parameters
[in]elemThe drawing element.
Returns
  • The concrete type of the given drawing element reference.
  • SURefType_Unknown if entity is not a valid drawing element.
SU_RESULT SUDrawingElementSetCastsShadows ( SUDrawingElementRef  elem,
bool  casts_shadows_flag 
)

Sets the casts shadows flag of a drawing element.

Parameters
[in]elemThe drawing element.
[in]casts_shadows_flagThe casts shadows flag to set.
Returns
SU_RESULT SUDrawingElementSetHidden ( SUDrawingElementRef  elem,
bool  hide_flag 
)

Sets the hide flag of a drawing element.

Parameters
[in]elemThe drawing element.
[in]hide_flagThe hide flag to set.
Returns
SU_RESULT SUDrawingElementSetLayer ( SUDrawingElementRef  elem,
SULayerRef  layer 
)

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

Parameters
[in]elemThe drawing element.
[in]layerThe layer object to set.
Returns
SU_RESULT SUDrawingElementSetMaterial ( SUDrawingElementRef  elem,
SUMaterialRef  material 
)

Sets the material of a drawing element.

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

Parameters
[in]elemThe drawing element.
[in]materialThe material object to set. If an invalid reference is given, then the material of the element will be removed.
Returns
SU_RESULT SUDrawingElementSetReceivesShadows ( SUDrawingElementRef  elem,
bool  receives_shadows_flag 
)

Sets the receives shadows flag of a drawing element.

Parameters
[in]elemThe drawing element.
[in]receives_shadows_flagThe casts shadows flag to set.
Returns
SU_EXPORT SUEntityRef SUDrawingElementToEntity ( SUDrawingElementRef  elem)

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

Parameters
[in]elemThe given drawing element reference.
Returns
  • The converted SUEntityRef if elem is a valid drawing element.
  • If not, the returned reference will be invalid.