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

References a the model selection. This is only available from within the SketchUp application. More...

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

## Related Functions
(Note that these are not member functions.)
enum SUResult | SUSelectionAdd (SUSelectionRef selection, size_t num_elements, const SUDrawingElementRef elements[])
| Adds items to the selection set. More...
enum SUResult | SUSelectionRemove (SUSelectionRef selection, size_t num_elements, const SUDrawingElementRef elements[])
| Removes items from the selection set. More...
enum SUResult | SUSelectionToggle (SUSelectionRef selection, size_t num_elements, const SUDrawingElementRef elements[])
| Toggle items in the selection set. More...
enum SUResult | SUSelectionClear (SUSelectionRef selection)
| Clears the selection set. More...
enum SUResult | SUSelectionInvert (SUSelectionRef selection)
| Inverts the selection set. More...
enum SUResult | SUSelectionGetNumElements (SUSelectionRef selection, size_t *num_elements)
| Gets the number of items in the selection set. More...
enum SUResult | SUSelectionGetEntityList (SUSelectionRef selection, SUEntityListRef *entity_list)
| Fills the list with items from the selection set. More...
enum SUResult | SUSelectionIsType (SUSelectionRef selection, enum SUSelectionType type, bool *is_type)
| Used to determine the type of selection. More...

## Detailed Description

References a the model selection. This is only available from within the SketchUp application.

## Friends And Related Function Documentation

enum SUResult SUSelectionAdd | ( | SUSelectionRef | selection,
|  | size_t | num_elements,
|  | const SUDrawingElementRef | elements[]
| ) |  |
| related

Adds items to the selection set.

Since
  SketchUp 2020.2, API 8.2

Parameters

  [in] | selection | The selection object.
  [in] | num_elements | The length of the array of drawing elements.
  [in] | elements | The array of drawing elements objects to add.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if selection is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if elements is NULL

enum SUResult SUSelectionClear | ( | SUSelectionRef | selection | ) |
| related

Clears the selection set.

Since
  SketchUp 2020.2, API 8.2

Parameters

  [in] | selection | The selection object.

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

enum SUResult SUSelectionGetEntityList | ( | SUSelectionRef | selection,
|  | SUEntityListRef * | entity_list
| ) |  |
| related

Fills the list with items from the selection set.

Since
  SketchUp 2020.2, API 8.2

Parameters

  [in] | selection | The selection object.
  [out] | entity_list | The list object to be filled.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if selection is not a valid object
  - SU_ERROR_INVALID_OUTPUT if entity_list not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if entity_list is NULL

enum SUResult SUSelectionGetNumElements | ( | SUSelectionRef | selection,
|  | size_t * | num_elements
| ) |  |
| related

Gets the number of items in the selection set.

Since
  SketchUp 2020.2, API 8.2

Parameters

  [in] | selection | The selection object.
  [out] | num_elements | The number of items in the selection set.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if selection is not a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if num_elements is NULL

enum SUResult SUSelectionInvert | ( | SUSelectionRef | selection | ) |
| related

Inverts the selection set.

Since
  SketchUp 2020.2, API 8.2

Parameters

  [in] | selection | The selection object.

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

enum SUResult SUSelectionIsType | ( | SUSelectionRef | selection,
|  | enum SUSelectionType | type,
|  | bool * | is_type
| ) |  |
| related

Used to determine the type of selection.

Since
  SketchUp 2020.2, API 8.2

Parameters

  [in] | selection | The selection object.
  [in] | type | The type of selection to query for.
  [out] | is_type | True if the selection is of the type queried for.

See Also
  SUSelectionType

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if selection is not a valid object
  - SU_ERROR_OUT_OF_RANGE if type is not a supported value
  - SU_ERROR_NULL_POINTER_OUTPUT if is_curve is NULL

enum SUResult SUSelectionRemove | ( | SUSelectionRef | selection,
|  | size_t | num_elements,
|  | const SUDrawingElementRef | elements[]
| ) |  |
| related

Removes items from the selection set.

Since
  SketchUp 2020.2, API 8.2

Parameters

  [in] | selection | The selection object.
  [in] | num_elements | The length of the array of drawing elements.
  [in] | elements | The array of drawing elements objects to remove.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if selection is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if elements is NULL

enum SUResult SUSelectionToggle | ( | SUSelectionRef | selection,
|  | size_t | num_elements,
|  | const SUDrawingElementRef | elements[]
| ) |  |
| related

Toggle items in the selection set.

Since
  SketchUp 2020.2, API 8.2

Parameters

  [in] | selection | The selection object.
  [in] | num_elements | The length of the array of drawing elements.
  [in] | elements | The array of drawing elements objects to toggle.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if selection is not a valid object
  - SU_ERROR_NULL_POINTER_INPUT if elements is NULL

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

- SketchUpAPI/model/defs.h
- SketchUpAPI/model/selection.h