Layer ===== .. py:class:: py3dm.Layer Bases: :py:obj:`ModelComponent` Python bindings for the openNURBS ``ON_Layer`` class. .. py:method:: __repr__() -> str .. py:property:: color :type: tuple[int, int, int, int] .. py:property:: full_path :type: str .. py:property:: iges_level :type: int .. py:property:: is_expanded :type: bool .. py:property:: is_locked :type: bool .. py:property:: is_visible :type: bool .. py:property:: layer_uuid :type: uuid.UUID .. py:property:: line_type_index :type: int .. py:property:: parent_uuid :type: uuid.UUID .. py:property:: path_separator :type: str .. py:property:: persistent_locking :type: bool .. py:property:: persistent_visibility :type: bool .. py:property:: plot_color :type: tuple[int, int, int, int] .. py:property:: plot_weight :type: float .. py:property:: render_material_index :type: int .. py:method:: get_name() -> str Returns the value of the name attribute. .. rubric:: Notes If the component is in a model, then the name is unique among all components in the model. Names are formatted as reference : parent::leaf. For example in ``A.3dm : Z``, ``A.3dm`` is the reference and ``Z`` is the leaf. For a layer full path ``X::Y::Z``, ``X::Y`` is the parent and ``Z`` is the leaf. For most models, only the leaf is present in the name. The reference portion appears when a model component originates in a reference file (a linked instance definition with reference component names or a worksession reference). Components with a tree hierarchy, like layers, can have a parent and leaf. .. py:method:: is_valid(text_log: TextLog | None = None) -> bool .. py:method:: set_name(name: str) -> bool Returns ``True`` if the name attribute was changed to ``name`` or is already equal to ``name``; returns ``False`` and no changes are made if the name attribute is locked and ``name !=`` locked value or ``name`` is not empty and ``ON_ModelComponent::IsValidComponentName(name)`` is ``False``. .. rubric:: Notes Leading and trailing non-zero unicode code points with values lower than equal ``ON_wString::Space`` are ignored. If ``name`` is the empty string, the ``name_is_state`` state will still be ``True``.