compas_cadwork.elements
¤
Classes¤
Beam
¤
Beam element.
Methods:¤
circular
classmethod
¤
Create circular beam.
Parameters:
-
frame(Frame) –Local coordinate system of the element.
-
length(float) –Length in millimeters (along X-axis).
-
diameter(float) –Section diameter in millimeters (along Y/Z-axes).
Returns:
-
Beam–New beam element.
Raises:
-
ValueError–If any of the dimensions are not positive.
polygonal
classmethod
¤
Create polygonal beam.
Parameters:
-
frame(Frame) –Local coordinate system of the element.
-
length(float) –Length in millimeters (along X-axis).
-
section(Polygon) –Polygon defining the section. Note that the Z coordinate of its points must be zero.
Returns:
-
Beam–New beam element.
Raises:
-
ValueError–If the Z coordinate of any of the polygon points is not zero, or if the length is not positive.
rectangular
classmethod
¤
Create rectangular beam.
Parameters:
-
frame(Frame) –Local coordinate system of the element.
-
length(float) –Length in millimeters (along X-axis).
-
width(float) –Section width in millimeters (along Y-axis).
-
height(float) –Section height in millimeters (along Z-axis).
Returns:
-
Beam–New beam element.
Raises:
-
ValueError–If any of the dimensions are not positive.
Element
¤
Generic Cadwork element.
Note
Avoid calling directly, use Project.element() instead to get the proper element class instance.
Parameters:
-
cadwork_id(ElementId) –Cadwork element ID.
Attributes¤
attribute_keys
class-attribute
¤
User attribute keys (i.e., names).
group
property
writable
¤
group: str | None
Group (or subgroup) name.
Note
Maps to the appropriate attribute depending on the element grouping type configuration for the project.
id
instance-attribute
¤
id: Final[ElementId] = cadwork_id
Cadwork element ID.
Note
This identifier may change when the program is restarted.
Do NOT rely on it as a unique ID, use Element.guid instead.
Methods:¤
ElementType
¤
Cadwork element type.
-
API Reference
elements ClassesElementType Methods:from_cadwork
Methods:¤
from_cadwork
classmethod
¤
from_cadwork(raw_type: element_type) -> ElementType
Get value from Cadwork element type.
Parameters:
-
raw_type(element_type) –Cadwork element type.
Returns:
-
ElementType–Element type.
Raises:
-
ValueError–If cannot determine the correct mapping type.
IfcElementType
¤
IFC element type.
Methods:¤
from_cadwork
classmethod
¤
from_cadwork(raw_type: ifc_2x3_element_type) -> IfcElementType
Get value from Cadwork IFC2x3 element type.
Parameters:
-
raw_type(ifc_2x3_element_type) –Cadwork IFC2x3 element type.
Returns:
-
IfcElementType–IFC element type.
Raises:
-
ValueError–If cannot determine the correct mapping type.
to_cadwork
¤
Convert value to Cadwork IFC2x3 element type.
Returns:
-
ifc_2x3_element_type–Cadwork IFC2x3 element type.
IfcPredefinedType
¤
IFC predefined type.
Methods:¤
from_cadwork
classmethod
¤
from_cadwork(raw_type: ifc_predefined_type) -> IfcPredefinedType
Get value from Cadwork IFC predefined type.
Parameters:
-
raw_type(ifc_predefined_type) –Cadwork IFC predefined type.
Returns:
-
IfcPredefinedType–IFC predefined type.
Raises:
-
ValueError–If cannot determine the correct mapping type.
to_cadwork
¤
Convert value to Cadwork IFC predefined type.
Returns:
-
ifc_predefined_type–Cadwork IFC predefined type.
OrientedElement
¤
Panel
¤
Panel element.
Methods:¤
polygonal
classmethod
¤
Create polygonal element.
Parameters:
-
frame(Frame) –Local coordinate system of the element.
-
outline(Polygon) –Polygon defining the outline. Note that the Z coordinate of its points must be zero.
-
thickness(float) –Thickness in millimeters (along Z-axis).
Returns:
-
Self–New element.
Raises:
-
ValueError–If the Z coordinate of any of the polygon points is not zero, or if the thickness is not positive.
rectangular
classmethod
¤
Create rectangular element.
Parameters:
-
frame(Frame) –Local coordinate system of the element.
-
length(float) –Length in millimeters (along X-axis).
-
width(float) –Width in millimeters (along Y-axis).
-
thickness(float) –Thickness in millimeters (along Z-axis).
Returns:
-
Self–New element.
Raises:
-
ValueError–If any of the dimensions are not positive.