.. highlightlang:: us .. _objgetfirst: ObjGetFirst =========== .. index:: ObjGetFirst .. us.tag ObjGetFirst ENGLISH :ref:`ObjGetFirst` is called in conjunction with :ref:`ObjGetNext` to iterate through all objects. .. function:: handleOut = ObjGetFirst() handleOut = ObjGetFirst(handle) handleOut = ObjGetFirst(ssClass) handleOut = ObjGetFirst(handle, ssClass) .. us.return **Return Value** *handleOut* is a handle. .. us.params **Parameters** .. uparam:: handle *handle* is a handle. .. uparam:: ssClass *ssClass* is a class name. .. us.comment **Comment** When the function is called with a class name - e.g. ``"OBJ_DOCUMENT"``, ``"OBJ_LAYER"``, ``"OBJ_TEXT"`` - :ref:`ObjGetFirst` will return the handle of the first object of the specified class. When the function is called with a handle, :ref:`ObjGetFirst` returns the handle of the object, that contains the specified object (Objects of type ``OBJ_DOCUMENT``, ``OBJ_PAGE`` and ``OBJ_LAYER`` can contain other objects). When the function is called with a handle and a class name, :ref:`ObjGetFirst` returns the object handle of the specified class that is owned by the object with the specified handle. Example: 17 is the handle of a diagram (``OBJ_LAYER``). ``ObjGetFirst(17, "OBJ_TEXT")`` will return the first text object of the diagram or 0 if the diagram does not contain any text objects. .. seealso:: :ref:`overview-objects`, :ref:`ObjCreate`, :ref:`ObjGetNext`, :ref:`ObjGetClass`, :ref:`ObjGet` :sub:`id-1594898`