LayOut C API

- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
entitylist.h File Reference
`#include <LayOutAPI/common.h>`
`#include <LayOutAPI/model/defs.h>`

Go to the source code of this file.

## Functions
LO_RESULT | LOEntityListCreate (LOEntityListRef *entity_list)
| Creates a new entity list object. More...
LO_RESULT | LOEntityListRelease (LOEntityListRef *entity_list)
| Releases an entity list object. *entity_list will be set to invalid by this function. More...
LO_RESULT | LOEntityListAddEntity (LOEntityListRef entity_list, LOEntityRef entity)
| Adds an entity to an entity list object. More...
LO_RESULT | LOEntityListGetNumberOfEntities (LOEntityListRef entity_list, size_t *num_entities)
| Gets the number of entities in an entity list object. More...
LO_RESULT | LOEntityListGetEntityAtIndex (LOEntityListRef entity_list, size_t index, LOEntityRef *entity)
| Gets the entity at the specified index in an entity list object. More...
LO_RESULT | LOEntityListMoveToLayer (LOEntityListRef entity_list, LOLayerRef layer, LOPageListRef pages)
| Moves a list of entities to the given layer. More...

## Function Documentation

LO_RESULT LOEntityListAddEntity | ( | LOEntityListRef | entity_list,
|  | LOEntityRef | entity
| ) |  |

Adds an entity to an entity list object.

Parameters

  [in] | entity_list | The entity list object.
  [in] | entity | The entity object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if entity_list does not refer to a valid object
  - SU_ERROR_INVALID_INPUT if entity does not refer to a valid object

LO_RESULT LOEntityListCreate | ( | LOEntityListRef * | entity_list | ) |

Creates a new entity list object.

Parameters

  [out] | entity_list | The entity list object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_OUTPUT if entity_list is NULL
  - SU_ERROR_OVERWRITE_VALID if *entity_list already refers to a valid object

LO_RESULT LOEntityListGetEntityAtIndex | ( | LOEntityListRef | entity_list,
|  | size_t | index,
|  | LOEntityRef * | entity
| ) |  |

Gets the entity at the specified index in an entity list object.

Parameters

  [in] | entity_list | The entity list object.
  [in] | index | The index of the entity to get.
  [out] | entity | The entity object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if entity_list does not refer to a valid object
  - SU_ERROR_OUT_OF_RANGE if index is out of range for this list
  - SU_ERROR_NULL_POINTER_OUTPUT if entity is NULL
  - SU_ERROR_OVERWRITE_VALID if *entity already refers to a valid object

LO_RESULT LOEntityListGetNumberOfEntities | ( | LOEntityListRef | entity_list,
|  | size_t * | num_entities
| ) |  |

Gets the number of entities in an entity list object.

Parameters

  [in] | entity_list | The entity list object.
  [out] | num_entities | The number of entities in this list.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if entity_list does not refer to a valid object
  - SU_ERROR_NULL_POINTER_OUTPUT if num_entities is NULL

LO_RESULT LOEntityListMoveToLayer | ( | LOEntityListRef | entity_list,
|  | LOLayerRef | layer,
|  | LOPageListRef | pages
| ) |  |

Moves a list of entities to the given layer.

If the layer is non-shared and any entity is on a shared layer, pages must be valid and populated with the pages to move the entities to. In all other cases, pages may be an invalid object. The entities must belong to the same document as the layer and pages.

Bug:
  In LayOut versions prior to LayOut 2024.0 this method would fail to move entities from non-shared layers.

Parameters

  [in] | entity_list | The entity list object.
  [in] | layer | The layer definition object.
  [in] | pages | The page list object.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_INVALID_INPUT if `entity_list` does not refer to a valid object
  - SU_ERROR_INVALID_INPUT if `entity_list` is empty
  - SU_ERROR_INVALID_INPUT if `entity_list` contains the same entity reference more than once
  - SU_ERROR_INVALID_INPUT if `layer` does not refer to a valid object
  - SU_ERROR_INVALID_INPUT if `pages` does not refer to a valid object and `layer` is non-shared
  - SU_ERROR_INVALID_INPUT if `pages` is empty and `layer` is non-shared
  - SU_ERROR_INVALID_INPUT if `pages` contains the same page reference more than once and `layer` is non-shared
  - SU_ERROR_GENERIC if any entity, `layer`, and `pages` are not all in the same document
  - SU_ERROR_LAYER_LOCKED if `layer` is locked or if any entity is currently on a locked layer

LO_RESULT LOEntityListRelease | ( | LOEntityListRef * | entity_list | ) |

Releases an entity list object. *entity_list will be set to invalid by this function.

Returns
  - SU_ERROR_NONE on success
  - SU_ERROR_NULL_POINTER_INPUT if entity_list is NULL
  - SU_ERROR_INVALID_INPUT if *entity_list does not refer to a valid object