Skip to content

compas_cadwork.materials ¤

Attributes¤

AnyLayerStack module-attribute ¤

Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Classes¤

FloorLayerStack ¤

FloorLayerStack(cadwork_id: MultiLayerSetId)
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Methods:¤

create classmethod ¤
create(name: str) -> Self
Software compatibility:
❌ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Layer dataclass ¤

Layer(*, name: str, type: LayerType, material: Material, thickness: float)
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Material layer.

Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Attributes¤

material instance-attribute ¤
material: Material
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Layer material.

name instance-attribute ¤
name: str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Layer name.

thickness instance-attribute ¤
thickness: float
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Layer thickness in millimeters.

type instance-attribute ¤
type: LayerType
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Layer type.

Methods:¤

__post_init__ ¤
__post_init__() -> None
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

LayerStack ¤

LayerStack(cadwork_id: MultiLayerSetId)
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

A collection of material layers to be used in elements with multi-layer support.

In Cadwork, these are called multi-layer covers or sets.

Create new instance wrapping a Cadwork multi-layer set.

Note

Avoid calling directly, use Project.layer_stack() instead to get an error in case of invalid ID.

Parameters:

  • cadwork_id (MultiLayerSetId) –

    Cadwork multi-layer set ID.

Attributes¤

id instance-attribute ¤
id: Final[MultiLayerSetId] = cadwork_id
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
name property writable ¤
name: str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Layer stack name.

Methods:¤

__delitem__ ¤
__delitem__(index: int) -> None
__delitem__(index: slice) -> None
__delitem__(index: int | slice) -> None
Software compatibility:
❌ Cadwork 2024❌ Cadwork 2025✅ Cadwork 2026
__eq__ ¤
__eq__(other: object) -> bool
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
__getitem__ ¤
__getitem__(index: int) -> Layer
__getitem__(index: slice) -> list[Layer]
__getitem__(index: int | slice) -> Layer | list[Layer]
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
__hash__ ¤
__hash__() -> int
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
__iter__ ¤
__iter__() -> Iterator[Layer]
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
__len__ ¤
__len__() -> int
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
__repr__ ¤
__repr__() -> str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
__setitem__ ¤
__setitem__(index: int, value: Layer) -> None
__setitem__(index: slice, value: Iterable[Layer]) -> None
__setitem__(index: int | slice, value: Layer | Iterable[Layer]) -> None
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
create abstractmethod classmethod ¤
create(name: str) -> Self
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Create new layer stack.

Parameters:

  • name (str) –

    New layer stack name.

Returns:

  • Self –

    New layer stack instance.

insert ¤
insert(index: int, value: Layer) -> None
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

LayerType ¤

Layer type.

Attributes¤

AIR class-attribute instance-attribute ¤
AIR = air
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
COVERING class-attribute instance-attribute ¤
COVERING = covering
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
LATHING class-attribute instance-attribute ¤
LATHING = lathing
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
PANEL class-attribute instance-attribute ¤
PANEL = panel
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
STRUCTURE class-attribute instance-attribute ¤
STRUCTURE = structure
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
UNDEFINED class-attribute instance-attribute ¤
UNDEFINED = undefined
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Methods:¤

__repr__ ¤
__repr__() -> str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
from_cadwork classmethod ¤
from_cadwork(raw_type: multi_layer_type) -> Self
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Get value from Cadwork multi layer type.

Parameters:

  • raw_type (multi_layer_type) –

    Cadwork multi layer type.

Returns:

Raises:

  • ValueError –

    If cannot determine the correct mapping type.

to_cadwork ¤
to_cadwork() -> multi_layer_type
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Convert value to Cadwork multi layer type.

Returns:

  • multi_layer_type –

    Cadwork multi layer type.

Material ¤

Material(cadwork_id: MaterialId)
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

A material used in a Cadwork project.

Create new instance wrapping a Cadwork material.

Note

Avoid calling directly, use Project.material() instead to get an error in case of invalid ID.

Parameters:

  • cadwork_id (MaterialId) –

    Cadwork material ID.

Attributes¤

group property writable ¤
group: str | None
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Material group name.

id instance-attribute ¤
id: Final[MaterialId] = cadwork_id
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
name property writable ¤
name: str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Material name.

Note

This has to be unique, no other material in the project can have the same name.

Methods:¤

__eq__ ¤
__eq__(other: object) -> bool
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
__hash__ ¤
__hash__() -> int
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
__repr__ ¤
__repr__() -> str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
create classmethod ¤
create(name: str, raise_on_duplicate: bool = True) -> Material
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Create new material.

Parameters:

  • name (str) –

    New material name.

  • raise_on_duplicate (bool, default: True ) –

    Whether to raise an error if the material name is already in use. Otherwise, returns the existing material.

Returns:

Raises:

  • ValueError –

    If material name is empty or already in use.

RoofLayerStack ¤

RoofLayerStack(cadwork_id: MultiLayerSetId)
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Methods:¤

create classmethod ¤
create(name: str) -> Self
Software compatibility:
❌ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

WallLayerStack ¤

WallLayerStack(cadwork_id: MultiLayerSetId)
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Methods:¤

create classmethod ¤
create(name: str) -> Self
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026