Assembly
类型: 类
领域: 装配
推荐导入: from cadflow import Assembly
签名
class Assembly(assembly_id: 'str', name: 'Optional[str]' = None, components: 'Tuple[Component, ...]' = (), connectors: 'Tuple[Connector, ...]' = (), constraints: 'Tuple[Constraint, ...]' = (), grounded_component_ids: 'Tuple[str, ...]' = (), _metadata: 'Dict[str, Any]' = <factory>, _runtime: 'Dict[str, Any]' = <factory>) -> None
功能说明
Assembly 是 CadFlow 装配领域的公共类。
原始 API 说明
Product structure containing placed Part or subassembly components.
其他公共导入路径
from cadflow.assembly import Assembly
参数
| 名称 | 类型 | 必需 | 默认值 | 源码说明 |
|---|---|---|---|---|
assembly_id | 'str' | 是 | - | 源码 Docstring 未单独说明。 |
name | 'Optional[str]' | 否 | None | 源码 Docstring 未单独说明。 |
components | 'Tuple[Component, ...]' | 否 | () | 源码 Docstring 未单独说明。 |
connectors | 'Tuple[Connector, ...]' | 否 | () | 源码 Docstring 未单独说明。 |
constraints | 'Tuple[Constraint, ...]' | 否 | () | 源码 Docstring 未单独说明。 |
grounded_component_ids | 'Tuple[str, ...]' | 否 | () | 源码 Docstring 未单独说明。 |
_metadata | 'Dict[str, Any]' | 否 | <factory> | 源码 Docstring 未单独说明。 |
_runtime | 'Dict[str, Any]' | 否 | <factory> | 源码 Docstring 未单独说明。 |
返回值
类型: None
源码 Docstring 未声明更多返回语义。
异常
源码 Docstring 未声明更窄的异常契约。类型、数值、所有权、路径或后端状态无效时,仍可能抛出相应公共异常。
数据字段
| 名称 | 类型 | 默认值 |
|---|---|---|
assembly_id | 'str' | required |
name | 'Optional[str]' | None |
components | 'Tuple[Component, ...]' | () |
connectors | 'Tuple[Connector, ...]' | () |
constraints | 'Tuple[Constraint, ...]' | () |
grounded_component_ids | 'Tuple[str, ...]' | () |
_metadata | 'Dict[str, Any]' | factory |
_runtime | 'Dict[str, Any]' | factory |
公共成员
| 成员 | 类型 | 签名 | 说明 |
|---|---|---|---|
component_ids | method | (self) -> 'Tuple[str, ...]' | 见成员签名。 |
connector_ids | method | (self) -> 'Tuple[str, ...]' | 见成员签名。 |
constraint_ids | method | (self) -> 'Tuple[str, ...]' | 见成员签名。 |
get_component | method | (self, component_id: 'str') -> 'Component' | 见成员签名。 |
get_connector | method | (self, connector_id: 'str') -> 'Connector' | 见成员签名。 |
get_constraint | method | (self, constraint_id: 'str') -> 'Constraint' | 见成员签名。 |
to_dict | method | (self) -> 'Dict[str, Any]' | 见成员签名。 |
with_component | method | (self, component: 'Component') -> "'Assembly'" | 见成员签名。 |
with_component_placement | method | (self, component_id: 'str', placement: 'Placement') -> "'Assembly'" | 见成员签名。 |
with_connector | method | (self, connector: 'Connector') -> "'Assembly'" | 见成员签名。 |
with_constraint | method | (self, constraint: 'Constraint') -> "'Assembly'" | 见成员签名。 |
with_grounded_component | method | (self, component_id: 'str') -> "'Assembly'" | 见成员签名。 |
without_grounded_component | method | (self, component_id: 'str') -> "'Assembly'" | 见成员签名。 |
行为与约束
- 实例是不可变 dataclass 值;更新式工作流会返回替代值。
导入检查
from cadflow import Assembly