comet.CLayer¶
- class comet.CLayer¶
This section describes all functions for the comet.CLayer class.
Methods¶
- CLayer.getDocument()¶
Get the document this layer belongs to.
- Returns:
The document
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CLayer.getParent()¶
Get the parent layer of this layer.
- Returns:
The next parent layer or
None
when the layer is a top level layer- Return type:
CLayer | None
- Raises:
CometError – On internal error
- Available:
Illustrator®
- CLayer.setParent(parent)¶
Reparent this layer to a new parent.
The layer is moved so it is the topmost child of the new parent. To move the layer inside the same parent use
setIndex()
- Parameters:
parent –
The new parent layer.
The parameter type can be:
- Return type:
None
- Raises:
CometError – On internal error
TypeError – When parameter types are invalid
- Available:
Illustrator®
- CLayer.getChildren()¶
Get all child layers of this layer.
- Returns:
All direct child layers of this layer
- Return type:
- Raises:
CometError – On internal error
- Available:
Illustrator®
- CLayer.getSiblings(includeSelf=False)¶
Get all sibling layers of this layer.
- Parameters:
includeSelf (bool) – Should this layer be included in the result list?
- Returns:
All direct siblings of this layer
- Return type:
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
Illustrator®
- CLayer.getName()¶
Get the name of this layer.
- Returns:
The layer name
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CLayer.setName(name)¶
Rename this layer.
- Parameters:
name (str) – The new name
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter name is empty
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CLayer.getPath(delimiter=':')¶
Get the layer hierarchy of this layer as a string.
The delimiter string is used inbetween each layer.
InDesign® comet_pdf® This function is the same as
getName()
- CLayer.getIndex()¶
At which position is the layer at? Indices are counted beginning at 0 from the last layer.
- Returns:
The 0-based layer index
- Return type:
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CLayer.setIndex(index)¶
Move a layer to another index in the layer order. The layer is placed before the layer at the target index, moving all other layers behind index.
- Parameters:
index (int) –
The new index to place the layer at.
-1 or > layer count: Layer will be the new top layer
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
ValueError – When parameter index is < -1
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CLayer.getVisible()¶
Ascertain whether this layer is visible
- Returns:
The visibility state of this layer
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CLayer.setVisible(visible=True)¶
Set the visibility state of this layer
- Parameters:
visible (bool) –
Visibility state
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CLayer.getLocked()¶
Ascertain whether this layer is locked
- Returns:
The lock state of this layer
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CLayer.setLocked(locked=True)¶
Set the lock state of this layer
- Parameters:
locked (bool) –
Lock state
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CLayer.getPrintable()¶
Ascertain whether this layer is printable
- Returns:
The printable state of this layer
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CLayer.setPrintable(printable=True)¶
Set the printable state of this layer
- Parameters:
printable (bool) – Printable state
- Return type:
None
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CLayer.getFrames(includeSubFrames=False)¶
Get all frames that are on this layer
- Parameters:
includeSubFrames (bool) –
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Returns:
All frames currently on this layer
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CLayer.getItems(includeSubItems=False)¶
Get all items that are on this layer
- Parameters:
includeSubItems (bool) –
- Raises:
TypeError – When parameter types are invalid
CometError – On internal error
- Returns:
All items currently on this layer
- Return type:
- Available:
InDesign® comet_pdf® Illustrator®
- CScript:
- CLayer.remove()¶
Deletes this layer from it’s document. All subsequent calls to this layer’s functions will fail. Trying to delete the last layer of the document will raise a CometError.
- Return type:
None
- Raises:
CometError – On internal error
- Available:
InDesign® comet_pdf® Illustrator®
- CScript: