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

References a Tag Folder object. More...

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

## Related Functions
(Note that these are not member functions.)
SUEntityRef | SULayerFolderToEntity (SULayerFolderRef layer_folder)
| Converts from an SULayerFolderRef to an SUEntityRef. This is essentially an upcast operation. More...
SULayerFolderRef | SULayerFolderFromEntity (SUEntityRef entity)
| Converts from an SUEntityRef to an SULayerFolderRef. This is essentially a downcast operation so the given SUEntityRef must be convertible to an SULayerFolderRef. More...
enum SUResult | SULayerFolderCreate (SULayerFolderRef *layer_folder, const char *name)
| Creates a new layer folder object with the given name. More...
enum SUResult | SULayerFolderRelease (SULayerFolderRef *layer_folder)
| Deallocates a layer folder object. More...
enum SUResult | SULayerFolderGetName (SULayerFolderRef layer_folder, SUStringRef *name)
| Retrieves the name of a layer folder object. More...
enum SUResult | SULayerFolderSetName (SULayerFolderRef layer_folder, const char *name)
| Assigns the name of a layer folder object. More...
enum SUResult | SULayerFolderGetVisibility (SULayerFolderRef layer_folder, bool *visible)
| Retrieves the boolean flag indicating whether a layer folder object is visible. More...
enum SUResult | SULayerFolderSetVisibility (SULayerFolderRef layer_folder, bool visible)
| Sets the boolean flag indicating whether a layer folder object is visible. More...
enum SUResult | SULayerGroupGetVisibleOnNewScenes (SULayerFolderRef layer_folder, bool *visible)
| Retrieves the boolean flag indicating whether a layer folder object is visible by default on new scenes. More...
enum SUResult | SULayerGroupSetVisibleOnNewScenes (SULayerFolderRef layer_folder, bool visible)
| Sets the boolean flag indicating whether a layer folder object is visible by default on new scenes. More...
enum SUResult | SULayerFolderAddLayer (SULayerFolderRef layer_folder, SULayerRef layer)
| Adds a layer to the given layer folder. More...
enum SUResult | SULayerFolderRemoveLayer (SULayerFolderRef layer_folder, SULayerRef layer)
| Removes a layer from the given layer folder. More...
enum SUResult | SULayerFolderGetNumLayers (SULayerFolderRef layer_folder, size_t *count)
| Gets the number of layers that layer_folder contains. More...
enum SUResult | SULayerFolderGetLayers (SULayerFolderRef layer_folder, size_t len, SULayerRef *layers, size_t *count)
| Gets the layers that are in the layer_folder. More...
enum SUResult | SULayerFolderAddLayerFolder (SULayerFolderRef layer_folder, SULayerFolderRef add_folder)
| Adds a SULayerFolderRef object to the given layer folder. More...
enum SUResult | SULayerFolderGetNumLayerFolders (SULayerFolderRef layer_folder, size_t *count)
| Gets the number of SULayerFolderRef objects that are direct children of the given layer folder object. More...
enum SUResult | SULayerFolderGetLayerFolders (SULayerFolderRef layer_folder, size_t len, SULayerFolderRef *layer_folders, size_t *count)
| Gets the SULayerFolderRef objects that are direct children of the given layer folder object. More...
enum SUResult | SULayerFolderGetParentLayerFolder (SULayerFolderRef layer_folder, SULayerFolderRef *parent)
| Gets the SULayerFolderRef object that contains the given layer folder. More...

## Detailed Description

References a Tag Folder object.

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

Since
  SketchUp 2021.0, API 9.0

## Friends And Related Function Documentation

enum SUResult SULayerFolderAddLayer | ( | SULayerFolderRef | layer_folder,
|  | SULayerRef | layer
| ) |  |
| related

Adds a layer to the given layer folder.

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.
  [in] | layer | The layer to add.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `layer_folder` or `layer` is not a valid object.
  - SU_ERROR_INVALID_ARGUMENT if `layer` can not be added to, or is already a member of, `layer_folder`.

enum SUResult SULayerFolderAddLayerFolder | ( | SULayerFolderRef | layer_folder,
|  | SULayerFolderRef | add_folder
| ) |  |
| related

Adds a SULayerFolderRef object to the given layer folder.

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The parent layer folder.
  [in] | add_folder | The layer folder to add.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `layer_folder` or `add_folder` is an invalid object
  - SU_ERROR_INVALID_ARGUMENT if `layer_folder` is not part of the model or `add_folder` fails to be added or is already contained within `layer_folder`.

enum SUResult SULayerFolderCreate | ( | SULayerFolderRef * | layer_folder,
|  | const char * | name
| ) |  |
| related

Creates a new layer folder object with the given name.

Layer Folders associated with a SketchUp model must not be explicitly deallocated. Layer folders that are not associated with a SketchUp model must be deallocated with SULayerFolderRelease().

Note
  Layer folder names do not need to be unique, but they can not be empty.

Since
  SketchUp 2021.0, API 9.0

Parameters

  [out] | layer_folder | The layer folder object created.
  [in] | name | The desired layer folder name. Assumed to be UTF-8 encoded.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if `layer_folder` is NULL
  - SU_ERROR_NULL_POINTER_INPUT if `name` is NULL
  - SU_ERROR_INVALID_ARGUMENT if `name` is an empty string

SULayerFolderRef SULayerFolderFromEntity | ( | SUEntityRef | entity | ) |
| related

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

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | entity | The given entity reference.

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

enum SUResult SULayerFolderGetLayerFolders | ( | SULayerFolderRef | layer_folder,
|  | size_t | len,
|  | SULayerFolderRef * | layer_folders,
|  | size_t * | count
| ) |  |
| related

Gets the SULayerFolderRef objects that are direct children of the given layer folder object.

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.
  [in] | len | The number of elements in `layer_folders`.
  [out] | layer_folders | An array of layer folder objects.
  [out] | count | The number of elements written into `layer_folders`.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `model` is an invalid object
  - SU_ERROR_NULL_POINTER_OUTPUT if `layer_folders` or `count` is NULL

enum SUResult SULayerFolderGetLayers | ( | SULayerFolderRef | layer_folder,
|  | size_t | len,
|  | SULayerRef * | layers,
|  | size_t * | count
| ) |  |
| related

Gets the layers that are in the layer_folder.

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.
  [in] | len | The number of elements in the layers array.
  [out] | layers | The layers that are in the layer folder.
  [out] | count | The number of layers read into the layers array.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `layer_folder` is not a valid object.
  - SU_ERROR_NULL_POINTER_OUTPUT if `layers` or `count` is NULL.

enum SUResult SULayerFolderGetName | ( | SULayerFolderRef | layer_folder,
|  | SUStringRef * | name
| ) |  |
| related

Retrieves the name of a layer folder object.

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.
  [out] | name | The name retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `layer_folder` is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if `name` is NULL
  - SU_ERROR_INVALID_OUTPUT if `name` does not point to a valid SUStringRef object

enum SUResult SULayerFolderGetNumLayerFolders | ( | SULayerFolderRef | layer_folder,
|  | size_t * | count
| ) |  |
| related

Gets the number of SULayerFolderRef objects that are direct children of the given layer folder object.

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.
  [out] | count | The number of layer folder objects that are direct children.

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

enum SUResult SULayerFolderGetNumLayers | ( | SULayerFolderRef | layer_folder,
|  | size_t * | count
| ) |  |
| related

Gets the number of layers that layer_folder contains.

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.
  [out] | count | The number of layers.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `layer_folder` is not a valid object.
  - SU_ERROR_NULL_POINTER_OUTPUT if `count` is NULL

enum SUResult SULayerFolderGetParentLayerFolder | ( | SULayerFolderRef | layer_folder,
|  | SULayerFolderRef * | parent
| ) |  |
| related

Gets the SULayerFolderRef object that contains the given layer folder.

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.
  [out] | parent | The retrieved parent layer folder object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `layer_folder` is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if `layer_folder` is NULL
  - SU_ERROR_NO_DATA if `layer_folder` is not contained within a layer folder

enum SUResult SULayerFolderGetVisibility | ( | SULayerFolderRef | layer_folder,
|  | bool * | visible
| ) |  |
| related

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

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.
  [out] | visible | The visibility flag retrieved.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `layer_folder` is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if `visible` is NULL

enum SUResult SULayerFolderRelease | ( | SULayerFolderRef * | layer_folder | ) |
| related

Deallocates a layer folder object.

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

Note
  To release a SULayerFolderRef that is owned by a model you should use SUModelRemoveLayerFolders().

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `layer_folder` points to an invalid object
  - SU_ERROR_NULL_POINTER_INPUT if `layer_folder` is NULL
  - SU_ERROR_INVALID_ARGUMENT if `layer_folder` is contained within a model.

enum SUResult SULayerFolderRemoveLayer | ( | SULayerFolderRef | layer_folder,
|  | SULayerRef | layer
| ) |  |
| related

Removes a layer from the given layer folder.

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.
  [in] | layer | The layer to remove.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `layer_folder` or `layer` is not a valid object.
  - SU_ERROR_INVALID_ARGUMENT if `layer` is not in `layer_folder`.

enum SUResult SULayerFolderSetName | ( | SULayerFolderRef | layer_folder,
|  | const char * | name
| ) |  |
| related

Assigns the name of a layer folder object.

Note
  Layer folder names do not need to be unique, but they can not be empty.

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.
  [in] | name | The new name of the layer folder object. Assumed to be UTF-8 encoded.

Returns
  - SU_ERROR_NONE if `layer_folder` is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if `name` is NULL
  - SU_ERROR_INVALID_ARGUMENT if `name` is an empty string

enum SUResult SULayerFolderSetVisibility | ( | SULayerFolderRef | layer_folder,
|  | bool | visible
| ) |  |
| related

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

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.
  [in] | visible | The visibility flag to set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `layer_folder` is not a valid object.

SUEntityRef SULayerFolderToEntity | ( | SULayerFolderRef | layer_folder | ) |
| related

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

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The given layer folder reference.

Returns
  - The converted SUEntityRef if `layer_folder` is a valid layer folder
  - If not, the returned reference will be invalid

enum SUResult SULayerGroupGetVisibleOnNewScenes | ( | SULayerFolderRef | layer_folder,
|  | bool * | visible
| ) |  |
| related

Retrieves the boolean flag indicating whether a layer folder object is visible by default on new scenes.

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.
  [out] | visible | The visibility flag retrieved.

See Also
  SUSceneLayerFolders()

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `layer_folder` is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if `visible` is NULL

enum SUResult SULayerGroupSetVisibleOnNewScenes | ( | SULayerFolderRef | layer_folder,
|  | bool | visible
| ) |  |
| related

Sets the boolean flag indicating whether a layer folder object is visible by default on new scenes.

Since
  SketchUp 2021.0, API 9.0

Parameters

  [in] | layer_folder | The layer folder object.
  [in] | visible | The visibility flag to set.

See Also
  SUSceneAddLayerFolder()
  SUSceneRemoveLayerFolder()

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `layer_folder` is not a valid object.

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

- SketchUpAPI/model/defs.h
- SketchUpAPI/model/layer_folder.h