Layer

class py3dm.Layer

Bases: ModelComponent

Python bindings for the openNURBS ON_Layer class.

__repr__() str
property color: tuple[int, int, int, int]
property full_path: str
property iges_level: int
property is_expanded: bool
property is_locked: bool
property is_visible: bool
property layer_uuid: uuid.UUID
property line_type_index: int
property parent_uuid: uuid.UUID
property path_separator: str
property persistent_locking: bool
property persistent_visibility: bool
property plot_color: tuple[int, int, int, int]
property plot_weight: float
property render_material_index: int
get_name() str

Returns the value of the name attribute.

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.

is_valid(text_log: TextLog | None = None) bool
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.

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.