ModelComponent ============== .. py:class:: py3dm.ModelComponent Bases: :py:obj:`OpenNURBSObject` Python bindings for the openNURBS ``ON_ModelComponent`` class. ``ON_ModelComponent``: base class for all components in a model and manages the index, uuid and other information common to all components in a model. .. py:method:: get_index() -> int get_index(index: int) -> int Value of the runtime model component index attribute. :param index: Value to return if the index has not been set. ``ON_UNSET_INT_INDEX`` or indices of default components are often used for this parameter. :type index: int .. rubric:: Notes If the component is in a model, then the index is unique for all components of identical type in the model and is locked. If the index has not been set, ``ON_UNSET_INT_INDEX`` is returned. The ``get_index()`` value can change when saved in an archive (.3dm file). Use the `get_uuid()` when you need to reference model components in an archive. .. py:method:: get_uuid() -> uuid.UUID Value of the ``ON_UUID`` attribute. .. rubric:: Notes If the component is in a model, then the ``ON_UUID`` is unique for all components in the model and is locked. .. py:method:: parent_uuid_is_not_null() -> bool .. py:method:: parent_uuid_is_null() -> bool .. py:method:: set_uuid(new_uuid: uuid.UUID) -> bool set_uuid() -> uuid.UUID Sets the id to a new value created by ``ON_CreateUuid()``. :returns: **value** -- ``ON_nil_uuid`` if the ``ON_UUID`` was locked, otherwise the value of the new ``ON_UUID``. :rtype: UUID .. py:method:: uuid_is_not_null() -> bool .. py:method:: uuid_is_null() -> bool