You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/general/project.rst
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -921,6 +921,42 @@ Retrieves an item by its :ref:`Item ID <Item.id>`
921
921
922
922
:ref:`Item`.
923
923
924
+
----
925
+
926
+
.. _Project.layerByID:
927
+
928
+
Project.layerByID()
929
+
*********************************************
930
+
931
+
``app.project.layerByID(id)``
932
+
933
+
**Description**
934
+
935
+
Instance method on Project which, when given a valid ID value, returns the Layer object in the Project with that given ID.
936
+
937
+
**Parameters**
938
+
939
+
=========== ======================
940
+
``id`` A non-negative integer representing the ID of the Layer to be retrieved from the Project.
941
+
=========== ======================
942
+
943
+
**Returns**
944
+
945
+
:ref:`Layer` with the given ID if it exists on the project; otherwise null. Non-valid IDs will throw an exception stating that the input parameter is not an unsigned integer.
946
+
947
+
**Example**
948
+
949
+
.. code:: javascript
950
+
951
+
var firstComp = app.project.item(1);
952
+
var firstLayer = firstComp.layer(1);
953
+
var layerID = firstLayer.id;
954
+
955
+
if (app.project.layerByID(layerID) === firstLayer) {
0 commit comments