SketchUp C API
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Related Functions
SULayerRef Struct Reference

References a Tag object. More...

#include <SketchUpAPI/model/layer.h>

Inherits SUEntityRef.

Related Functions

(Note that these are not member functions.)

SUEntityRef SULayerToEntity (SULayerRef layer)
 Converts from an SULayerRef to an SUEntityRef. This is essentially an upcast operation. More...
 
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...
 
enum SUResult SULayerCreate (SULayerRef *layer)
 Creates a new layer object. More...
 
enum SUResult SULayerRelease (SULayerRef *layer)
 Deallocates a layer object. More...
 
enum SUResult SULayerGetName (SULayerRef layer, SUStringRef *name)
 Retrieves the name of a layer object. More...
 
enum SUResult SULayerGetDisplayName (SULayerRef layer, SUStringRef *name)
 Retrieves the display name of a layer object. More...
 
enum SUResult SULayerSetName (SULayerRef layer, const char *name)
 Assigns the name of a layer object. More...
 
enum SUResult SULayerGetMaterial (SULayerRef layer, SUMaterialRef *material)
 Retrieves the material object associated with a layer object. More...
 
enum SUResult SULayerGetVisibility (SULayerRef layer, bool *visible)
 Retrieves the boolean flag indicating whether a layer object is visible. More...
 
enum SUResult SULayerSetVisibility (SULayerRef layer, bool visible)
 Sets the boolean flag indicating whether a layer object is visible. More...
 
enum SUResult SULayerGetLineStyle (SULayerRef layer, SULineStyleRef *line_style)
 Get the line style of a layer. More...
 
enum SUResult SULayerSetLineStyle (SULayerRef layer, SULineStyleRef line_style)
 Set the line style of a layer. More...
 
enum SUResult SULayerClearLineStyle (SULayerRef layer)
 Clear the line style of a layer. More...
 
enum SUResult SULayerGetSceneBehavior (SULayerRef layer, enum SULayerVisibilityDefaultType *default_type, enum SULayerVisibilityNewSceneType *new_scene_type)
 Get the scene behavior on the layer. More...
 
enum SUResult SULayerSetSceneBehavior (SULayerRef layer, enum SULayerVisibilityDefaultType default_type, enum SULayerVisibilityNewSceneType new_scene_type)
 Set the scene behavior on the layer. More...
 
enum SUResult SULayerGetParentLayerFolder (SULayerRef layer, SULayerFolderRef *layer_folder)
 Gets the SULayerFolderRef object that contains the given layer. More...
 

Detailed Description

References a Tag object.

Note
'Layer' is a legacy term that is being used for consistency within the API.

Friends And Related Function Documentation

enum SUResult SULayerClearLineStyle ( SULayerRef  layer)
related

Clear the line style of a layer.

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

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
SULayerRef SULayerFromEntity ( SUEntityRef  entity)
related

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
enum SUResult SULayerGetDisplayName ( SULayerRef  layer,
SUStringRef name 
)
related

Retrieves the display name of a layer object.

Since
SketchUp 2020.0, API version 8.0

The display name is the name you see in the product. In SketchUp 2020 the display name for the default layer changed from "Layer0" to "Untagged". For all other layers the name and display name are identical.

Parameters
[in]layerThe layer object.
[out]nameThe display name retrieved.
Returns
enum SUResult SULayerGetLineStyle ( SULayerRef  layer,
SULineStyleRef line_style 
)
related

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
enum SUResult SULayerGetMaterial ( SULayerRef  layer,
SUMaterialRef material 
)
related

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
enum SUResult SULayerGetName ( SULayerRef  layer,
SUStringRef name 
)
related

Retrieves the name of a layer object.

Parameters
[in]layerThe layer object.
[out]nameThe name retrieved.
Returns
enum SUResult SULayerGetParentLayerFolder ( SULayerRef  layer,
SULayerFolderRef layer_folder 
)
related

Gets the SULayerFolderRef object that contains the given layer.

Since
SketchUp 2020.2, API 8.2
Parameters
[in]layerThe layer object.
[out]layer_folderThe retrieved layer folder object.
Returns
enum SUResult SULayerGetSceneBehavior ( SULayerRef  layer,
enum SULayerVisibilityDefaultType default_type,
enum SULayerVisibilityNewSceneType new_scene_type 
)
related

Get the scene behavior on the layer.

Since
SketchUp 2020.0, API 8.0
Parameters
[in]layerThe layer object.
[out]default_typeThe retrieved default scene behavior.
[out]new_scene_typeThe retrieved behavior for new scenes.
Returns
enum SUResult SULayerGetVisibility ( SULayerRef  layer,
bool *  visible 
)
related

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

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

Deallocates a layer object.

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

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

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
enum SUResult SULayerSetName ( SULayerRef  layer,
const char *  name 
)
related

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
enum SUResult SULayerSetSceneBehavior ( SULayerRef  layer,
enum SULayerVisibilityDefaultType  default_type,
enum SULayerVisibilityNewSceneType  new_scene_type 
)
related

Set the scene behavior on the layer.

Since
SketchUp 2020.0, API 8.0
Parameters
[in]layerThe layer object.
[in]default_typeThe default scene behavior.
[in]new_scene_typeThe behavior to set for new scenes.
Returns
enum SUResult SULayerSetVisibility ( SULayerRef  layer,
bool  visible 
)
related

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

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

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

The documentation for this struct was generated from the following files: