Skip to content

compas_cadwork.datamodel ¤

Attributes¤

ATTR_INSTRUCTION_ID module-attribute ¤

ATTR_INSTRUCTION_ID = 666
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Classes¤

AnchorPoint dataclass deprecated ¤

AnchorPoint(location: Point, distance: float, direction: Vector)
Deprecated

Subject to removal, avoid using

Anchor point of a cadwork measurement. There may me 2 or more anchor points in a measurement.

Attributes:

  • location (Point) –

    The location of the anchor point in 3d space.

  • distance (float) –

    The distance of the anchor point from the measurement line.

  • direction (Vector) –

    The direction of the anchor point from the measurement line.

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

Attributes¤

direction instance-attribute ¤
direction: Vector
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
distance instance-attribute ¤
distance: float
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
location instance-attribute ¤
location: Point
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Methods:¤

__eq__ ¤
__eq__(other: object) -> bool
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Dimension deprecated ¤

Dimension(id)
Deprecated

Subject to removal, avoid using

Represents a cadwork dimension

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

Attributes¤

anchors instance-attribute ¤
anchors = _init_anchors()
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
frame property ¤
frame
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
length property ¤
length
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
text_normal property ¤
text_normal
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Methods:¤

__eq__ ¤
__eq__(other: object) -> bool
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
__hash__ ¤
__hash__()
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
__str__ ¤
__str__() -> str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Element dataclass deprecated ¤

Element(id: int)
Deprecated

Use compas_cadwork.elements.Element instead

Represents a cadwork Element

Parameters:

  • id (int) –

    The ID of the Element

Attributes:

  • name (str) –

    The name of the Element

  • frame (Frame) –

    The local coordinate system of the Element

  • width (float) –

    The width of the Element

  • height (float) –

    The height of the Element

  • length (float) –

    The length of the Element

  • group (str) –

    The group the Element belongs to. Either group or subgroup depending on the current grouping type.

  • ifc_base64_guid (str) –

    The base64 IFC GUID of the Element

  • cadwork_guid (str) –

    The cadwork GUID of the Element

  • centerline (Line) –

    The centerline of the Element.

  • midpoint (Point) –

    The midpoint of the Element's centerline.

  • ifc_guid (str) –

    The IFC GUID of the Element. See also: ifc_base64_guid.

  • is_beam (bool) –

    Whether the Element is a beam

  • is_wall (bool) –

    Whether the Element is a framed wall i.e. container for all other elements in the building group.

  • is_drilling (bool) –

    Whether the Element is a drilling hole

  • is_roof (bool) –

    Whether the Element is a framed roof i.e. container for all other elements in the building group.

  • is_floor (bool) –

    Whether the Element is a framed floor i.e. container for all other elements in the building group.

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

Attributes¤

cadwork_guid property ¤
cadwork_guid: str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
centerline property ¤
centerline: Line
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
frame property ¤
frame: Frame
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
group property ¤
group: str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
height property ¤
height: float
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
id instance-attribute ¤
id: int
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
ifc_base64_guid property ¤
ifc_base64_guid: str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
ifc_guid property ¤
ifc_guid: str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
is_beam property ¤
is_beam: bool
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
is_drilling property ¤
is_drilling: bool
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
is_floor property ¤
is_floor: bool
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
is_gridline property ¤
is_gridline: bool
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
is_instruction property ¤
is_instruction: bool
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
is_linear_dimension property ¤
is_linear_dimension: bool
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
is_opening property ¤
is_opening: bool
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
is_roof property ¤
is_roof: bool
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
is_wall property ¤
is_wall: bool
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
length property ¤
length: float
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
midpoint property ¤
midpoint: Point
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
name property ¤
name: str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
width property ¤
width: float
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Methods:¤

from_selection classmethod ¤
from_selection() -> Generator[Element]
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Returns a generator containing Element objects for all currently activated Elements

Returns:

  • Generator[Element] –

    A generator containing Element objects for all currently activated Elements

get_elements_in_contact ¤
get_elements_in_contact() -> list[Element]
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Returns a list of elements in contact with the current element

get_instruction_id ¤
get_instruction_id() -> str | None
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Returns the instruction ID of the Element

Returns:

  • (str, optional) –

    The instruction ID of the Element

remove ¤
remove()
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Removes the Element from the cadwork file

remove_attribute ¤
remove_attribute(attribute_number: int, value: str | None = None)
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Removes an attribute from the Element

Parameters:

  • attribute_number (int) –

    The number of the attribute (1-10)

  • value (str, default: None ) –

    The attribute value to remove from the user attribute list.

set_attribute ¤
set_attribute(attribute_number: int, name_or_value: str, value: str | None = None)
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Sets an attribute on the Element

Parameters:

  • attribute_number (int) –

    The number of the attribute (1-10)

  • name_or_value (str) –

    If value is provided, this is the name of the attribute. Otherwise, this is the user attribute value.

  • value (str, default: None ) –

    The value of the attribute

set_is_instruction ¤
set_is_instruction(value: bool, instruction_id: str | None = None)
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Sets the is_instruction attribute on the Element

Parameters:

  • value (bool) –

    If True, this Element will be flagged as an instruction element by setting the appropriate attribute. If False, the attribute will be removed.

  • instruction_id (str, default: None ) –

    The ID of the instruction. This is required when setting is_instruction to True.

translate ¤
translate(vector: Vector) -> None
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Translates the Element by the given vector.

Parameters:

  • vector (Vector) –

    The vector by which to translate the Element

ElementGroup dataclass deprecated ¤

ElementGroup(name: str, elements: list | None = None, wall_frame_element: Element | None = None)
Deprecated

Subject to removal, avoid using

Represents a cadwork Element Group

Parameters:

  • name (str) –

    The name of the Element Group

  • elements (list) –

    A list of Elements belonging to the Element Group

Attributes:

  • name (str) –

    The name of the Element Group

  • elements (list) –

    A list of Elements belonging to the Element Group

  • wall_frame_element ((Element, optional)) –

    The containing Element (often a wall element) which contains all other elements in the group. If any.

  • ifc_guid (str) –

    The IFC GUID of the container element, often used to represent the whole group. See also: ifc_base64_guid

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

Attributes¤

elements class-attribute instance-attribute ¤
elements: list | None = None
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
ifc_guid property ¤
ifc_guid: str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
name instance-attribute ¤
name: str
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
wall_frame_element class-attribute instance-attribute ¤
wall_frame_element: Element | None = None
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Methods:¤

add_element ¤
add_element(element: Element) -> None
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Adds an Element to the Element Group

Parameters:

  • element (Element) –

    The Element to add to the Element Group

ElementGroupingType deprecated ¤

Deprecated

Use cadwork.element_grouping_type instead

CADWork Element Grouping Type

Attributes:

  • GROUP –

    Elements are grouped using group as the main grouping type.

  • SUBGROUP –

    Elements are grouped using subgroup as the main grouping type.

  • NONE –

    Not setting is available.

Attributes¤

GROUP class-attribute instance-attribute ¤
GROUP = 1
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
NONE class-attribute instance-attribute ¤
NONE = 3
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026
SUBGROUP class-attribute instance-attribute ¤
SUBGROUP = 2
Software compatibility:
✅ Cadwork 2024✅ Cadwork 2025✅ Cadwork 2026

Methods:¤

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

Converts the ElementGroupingType to a cadwork compatible value.

Returns:

  • int –

    The cadwork compatible value of the ElementGroupingType