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

Go to the source code of this file.

Functions

SU_EXPORT SUEntityRef SULayerToEntity (SULayerRef layer)
 Converts from an SULayerRef to an SUEntityRef. This is essentially an upcast operation. More...
 
SU_EXPORT SULayerRef SULayerFromEntity (SUEntityRef entity)
 Converts from an SUEntityRef to an SULayerRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SULayerRef. More...
 
SU_RESULT SULayerCreate (SULayerRef *layer)
 Creates a new layer object. More...
 
SU_RESULT SULayerRelease (SULayerRef *layer)
 Deallocates a layer object. More...
 
SU_RESULT SULayerGetName (SULayerRef layer, SUStringRef *name)
 Retrieves the name of a layer object. More...
 
SU_RESULT SULayerSetName (SULayerRef layer, const char *name)
 Assigns the name of a layer object. More...
 
SU_RESULT SULayerGetMaterial (SULayerRef layer, SUMaterialRef *material)
 Retrieves the material object associated with a layer object. More...
 
SU_RESULT SULayerGetVisibility (SULayerRef layer, bool *visible)
 Retrieves the boolean flag indicating whether a layer object is visible. More...
 
SU_RESULT SULayerSetVisibility (SULayerRef layer, bool visible)
 Sets the boolean flag indicating whether a layer object is visible. More...
 
SU_RESULT SULayerGetLineStyle (SULayerRef layer, SULineStyleRef *line_style)
 Get the line style of a layer. More...
 
SU_RESULT SULayerSetLineStyle (SULayerRef layer, SULineStyleRef line_style)
 Set the line style of a layer. More...
 
SU_RESULT SULayerClearLineStyle (SULayerRef layer)
 Clear the line style of a layer. More...
 

Function Documentation

SU_RESULT SULayerClearLineStyle ( SULayerRef  layer)

Clear the line style of a layer.

Since
SketchUp 2019, API 7.0
Parameters
[in]layerThe layer object.
Returns
SU_RESULT SULayerCreate ( SULayerRef layer)

Creates a new layer object.

Layers associated with a SketchUp model must not be explicitly deallocated. Layers that are not associated with a SketchUp model must be deallocated with SULayerRelease.

Parameters
[out]layerThe layer object created.
Returns
SU_EXPORT SULayerRef SULayerFromEntity ( SUEntityRef  entity)

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

Parameters
[in]entityThe given entity reference.
Returns
  • The converted SULayerRef if the downcast operation succeeds
  • If not, the returned reference will be invalid
SU_RESULT SULayerGetLineStyle ( SULayerRef  layer,
SULineStyleRef *  line_style 
)

Get the line style of a layer.

Since
SketchUp 2019, API 7.0
Parameters
[in]layerThe layer object.
[out]line_styleThe line style reference.
Returns
SU_RESULT SULayerGetMaterial ( SULayerRef  layer,
SUMaterialRef material 
)

Retrieves the material object associated with a layer object.

The retrieved material object must not be deallocated by the caller since it is owned by the layer object.

Parameters
[in]layerThe layer object.
[out]materialThe material object retrieved.
Returns
SU_RESULT SULayerGetName ( SULayerRef  layer,
SUStringRef name 
)

Retrieves the name of a layer object.

Parameters
[in]layerThe layer object.
[out]nameThe name retrieved.
Returns
SU_RESULT SULayerGetVisibility ( SULayerRef  layer,
bool *  visible 
)

Retrieves the boolean flag indicating whether a layer object is visible.

Parameters
[in]layerThe layer object.
[out]visibleThe visibility flag retrieved.
Returns
SU_RESULT SULayerRelease ( SULayerRef layer)

Deallocates a layer object.

The layer object to be deallocated must not be associated with a SketchUp model.

Parameters
[in]layerThe layer object.
Returns
SU_RESULT SULayerSetLineStyle ( SULayerRef  layer,
SULineStyleRef  line_style 
)

Set the line style of a layer.

Since
SketchUp 2019, API 7.0
Parameters
[in]layerThe layer object.
[in]line_styleThe line style to set.
Returns
SU_RESULT SULayerSetName ( SULayerRef  layer,
const char *  name 
)

Assigns the name of a layer object.

Parameters
[in]layerThe layer object.
[in]nameThe new name of the layer object. Assumed to be UTF-8 encoded.
Returns
SU_RESULT SULayerSetVisibility ( SULayerRef  layer,
bool  visible 
)

Sets the boolean flag indicating whether a layer object is visible.

Parameters
[in]layerThe layer object.
[in]visibleThe visibility flag to set.
Returns
SU_EXPORT SUEntityRef SULayerToEntity ( SULayerRef  layer)

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

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