CATIA V6 CAA 装配模块二次开发常用接口库介绍
作者:CATIA开发者指南
发布时间:2026年6月24日 10:24
原文链接:https://mp.weixin.qq.com/s?__biz=MzkxNTQ0MTY0NQ==&mid=2247486556&idx=1&sn=0355568d491e355169bc27463b2448b9&chksm=c15e5edef629d7c86ed52a1d8ca45ba1ba9aada217b6a3d0d0914dad381a58c0aa8ddc237115&cur_album_id=2800898825187262468&scene=189#wechat_redirect
本文目标把 V6 装配模块二次开发真正需要的接口库分层讲清楚:产品结构、Reference / Instance、Occurrence / Representation Occurrence、上下文对象、Engineering Connection、装配约束、装配阵列、装配特征、派生表示,以及和自定义 feature 的关系。
1. 结论先行
V6 装配模块二开不要直接套用 V5 CATProduct 的思路。更稳的路线是先把对象分成三层:
- Reuse Model 层:
Product Reference、Product Instance、Representation Reference、Representation Instance,主要由ProductStructureInterfaces管理。 - Navigation / Context 层:
CATIPLMNavReference、CATIPLMNavInstance、CATIPLMNavOccurrence、CATIPLMNavRepOccurrence,主要由CATPLMComponentInterfaces管理。 - Assembly Use 层:
Engineering Connection、Assembly Constraint、Assembly Pattern、Assembly Feature、Derived Representation,由CATEngConnectionUseItf、CATAssemblyConstraintUseItf、CATAsmPatternUseItf、CATAsmFunctionalUseItf、CATAssemblyUseItf管理。
如果只记一句话:
V6 装配开发的主线是“Reference/Instance 管数据结构,Occurrence 管上下文投影,ObjectInContext 管选择语义,Engineering Connection 管约束网络,Assembly Feature/Pattern 管装配级特征”。
2. 先把核心对象关系说清楚
V6 装配里的对象比 V5 更强调 PLM reuse model 和 occurrence 上下文。规格树上看到的一个零部件节点,背后可能同时涉及 reference、instance、occurrence、representation instance 和 representation occurrence。
Product Reference
-> Product Instance
-> Product Reference
-> Representation Instance
-> Representation Reference / 3D Shape
Navigation Projection
-> CATIPLMNavOccurrence
-> CATIPLMNavRepOccurrence
Context Wrapper
-> CATOmbObjectInContext
= path of instances + representation instance + target object
Assembly Objects
-> Engineering Connection
-> Assembly Constraint
-> Assembly Pattern
-> Assembly Feature
-> impacts on Representation Occurrences
这里最容易混淆的是:
Reference是定义本体。Instance是复用模型中的一次实例化。Occurrence是在某个上下文下的投影,本身没有自己的属性。Representation Occurrence是表示实例在装配上下文里的投影。CATOmbObjectInContext用来表达“某个对象在某条产品路径/表示上下文中”。- 装配约束和装配特征通常不是只传裸几何,而是传带上下文的对象。
3. V6 相比旧式装配写法的关键变化
V5 装配开发常围绕 CATIProduct、CATIMovable、CATIPrdProperties、CATPathElement 和 constraint connector 展开。V6 中,很多装配能力已经围绕 PLM Nav 与 UseItf 重构,常见接口包括:
CATIPLMProductsCATIPrdObjectCATIPrdOccurrenceMngtCATIPLMNavOccurrenceCATIPLMNavRepOccurrenceCATOmbObjectInContextCATIEngConnectionManagerCATIAssemblyConstraintManagerCATIAssemblyUsePatternManagerCATIAssemblyFeatureManager
因此写 V6 装配二开时,第一步不是“拿到 CATProduct 后直接遍历”,而是确认你当前拿到的是:
- Product reference 还是 product instance?
- Nav reference / nav instance 还是 occurrence?
- 是否有 root occurrence?
- 是否需要 representation occurrence?
- 目标 API 是否要求
CATOmbObjectInContext?
4. 常用接口库总览
| 需求 | Framework | 常用接口 |
|---|---|---|
| 产品结构增删改查 | ProductStructureInterfaces | CATIPLMProducts, CATIPrdObject, CATIPrdIterator |
| Representation instance 管理 | ProductStructureInterfaces | CATIPLMRepInstances, CATIPrdRepInstance |
| Occurrence 计算与同步 | ProductStructureInterfaces | CATIPrdOccurrenceMngt, CATPrdGetOccurrenceMngt, CATPathOfFirstInstances |
| PLM Nav 基础导航 | CATPLMComponentInterfaces | CATIPLMNavEntity, CATIPLMNavReference, CATIPLMNavInstance |
| 装配上下文导航 | CATPLMComponentInterfaces | CATIPLMNavOccurrence, CATIPLMNavRepOccurrence |
| Representation 导航和容器进入 | CATPLMComponentInterfaces | CATIPLMNavRepReference, CATIPLMNavRepInstance, CATIPLMNavRepOccurrence |
| 上下文包装 | ObjectModelerBase | CATOmbObjectInContext |
| Engineering Connection | CATEngConnectionUseItf | CATIEngConnectionManager, CATIEngConnection, CATIAssemblyDOFDescriptor |
| 装配约束 | CATAssemblyConstraintUseItf | CATIAssemblyConstraintManager, CATIAssemblyConstraint |
| 装配阵列 | CATAsmPatternUseItf | CATCreateAssemblyUsePatternManager, CATIAssemblyUsePatternManager, CATIAssemblyUsePattern |
| 装配特征和 impacts | CATAsmFunctionalUseItf | CATCreateAssemblyFeatureManager, CATIAssemblyFeatureManager, CATIAssemblyFeature |
| 派生表示、对称 | CATAssemblyUseItf | CATIDerivedRepManager, CATIAssemblySymmetryReference, CATIAssemblySymmetryInstance |
| 通用生命周期 | DataCommonProtocolUse | CATIUseEntity, DataCommonProtocolServices, CATIUpdateProvider, CATIReplace |
| 自定义业务 feature | FeatureModelerExt | CATFmStartUpFacade, CATFmFeatureFacade, CATFmContainerFacade, CATIFmFeatureBehaviorCustomization |
5. 产品结构:CATIPLMProducts 和 CATIPrdObject
5.1 CATIPLMProducts:增删改查产品结构
ProductStructureInterfaces/PublicInterfaces/CATIPLMProducts.h 是 V6 产品结构编辑的重要接口。它既能导航产品结构,也能添加、删除、替换 Product Instance。
常用能力:
| 方法 | 作用 |
|---|---|
| AddProduct() | 在 Product Reference 下实例化另一个 Product Reference |
| AddProducts() | 批量添加多个 Product Reference |
| RemoveProduct() | 删除直接子 Product Instance |
| RemoveProductByName() | 按实例名删除直接子实例 |
| Count() | 获取直接子产品数量 |
| GetProductByName() | 按实例名查直接子产品 |
| Iterator() | 遍历直接子产品 |
示例结构:
CATIPLMProducts *pParentRef = ...; // 必须是 Product Reference
CATIPLMProducts *pChildRef = ...; // 要实例化的 Product Reference
CATBaseUnknown *pNewInstance = NULL;
HRESULT hr = pParentRef->AddProduct(pChildRef, pNewInstance, IID_CATIPrdObject);
if (SUCCEEDED(hr) && pNewInstance != NULL)
{
CATIPrdObject *pNewPrdObject = (CATIPrdObject*)pNewInstance;
// 使用新实例
pNewInstance->Release();
pNewInstance = NULL;
}
关键点:
AddProduct()通常必须在 Product Reference 上调用。RemoveProduct()要求被删除对象是调用者的直接子 Product Instance。- 用 iterator 遍历时不要同时修改结构。
- 接口返回的
CATBaseUnknown*通常需要按头文件说明Release()。
5.2 CATIPrdObject:Reference / Instance / 父子关系
ProductStructureInterfaces/PublicInterfaces/CATIPrdObject.h 用来在 PLM typed feature 上导航,典型实现对象包括 Product Instance、Product Reference、Representation Instance、Port、Connection 等。
常用能力:
| 方法 | 作用 |
|---|---|
| GetFatherProduct() | 获取父产品 |
| GetRootFather() | 获取根父产品 |
| GetReferenceObject() | instance -> reference;reference 调用时返回自己 |
| IsReference() | 判断当前对象是否是 Reference |
| FindInstance(context) | 在给定上下文中查找实例 |
| GetInstances() | 获取 reference-to-instance 路径上的实例 iterator |
| GetAllInstances() | 获取某 reference 的所有实例 iterator |
建议封装一个小工具函数,把当前对象标准化成 reference 和 instance 两种视图:
输入对象
-> CATIPrdObject
-> IsReference()
true: 当前是 reference,按需要 FindInstance(context)
false: 当前是 instance,GetReferenceObject()
不要在业务代码里假定当前选择一定是 instance,也不要把 reference 上的操作误当成 instance 上的位置/上下文操作。
6. Representation:产品下的 3D Shape 和技术表示
6.1 CATIPLMRepInstances
ProductStructureInterfaces/PublicInterfaces/CATIPLMRepInstances.h 管 Product 聚合的 Representation Instance。
常用方法:
| 方法 | 作用 |
|---|---|
| Count() | 获取 Product 下 Representation Instance 数量 |
| Iterator() | 遍历 Representation Instance |
| AddRepInstance() | 在 Product Reference 下添加 Representation Instance |
| GetRepInstanceByName() | 按名称查找 Representation Instance |
| RemoveRepInstance() | 删除 Representation Instance |
| ReplaceRepInstance() | 替换 Representation Instance |
注意:
AddRepInstance()必须在 Product Reference 上调用。- 技术表示可能有“一次实例化”限制。
- 替换技术表示可能失败,头文件中明确提到 Technological Representation 的限制。
6.2 CATIPLMNavRepReference / CATIPLMNavRepOccurrence
CATPLMComponentInterfaces/PublicInterfaces/CATIPLMNavRepReference.h 和 CATPLMComponentInterfaces/PublicInterfaces/CATIPLMNavRepOccurrence.h 是进入 representation 的关键。
常用能力:
| 接口 | 方法 | 作用 |
|---|---|---|
| CATIPLMNavRepReference | ListInstances() | 列出 rep reference 的 rep instances |
| CATIPLMNavRepReference | RetrieveApplicativeContainer() | 从 rep reference 取得 applicative container |
| CATIPLMNavRepReference | GetContentKind() | 获取 authoring stream content kind |
| CATIPLMNavRepReference | IsOnceInstantiable() | 判断是否只能实例化一次 |
| CATIPLMNavRepOccurrence | GetFather() | 获取父 product occurrence |
| CATIPLMNavRepOccurrence | GetRelatedRepInstance() | rep occurrence -> rep instance |
| CATIPLMNavRepOccurrence | GetRelatedRepReference() | rep occurrence -> rep reference |
| CATIPLMNavRepOccurrence | RetrieveApplicativeContainer() | 从上下文表示取得 applicative container |
这层和零件模块衔接非常紧:如果你要进入 3D Shape 的 Part 容器、自定义 feature 容器或装配 feature impact 目标,往往都要先拿到 CATIPLMNavRepReference 或 CATIPLMNavRepOccurrence。
7. Occurrence:V6 装配上下文的核心
7.1 CATIPLMNavOccurrence
CATPLMComponentInterfaces/PublicInterfaces/CATIPLMNavOccurrence.h 明确说明:Occurrence 是 contextual Instance-Reference pair 的 projection。它没有自己的属性,编辑必须委托给被投影的 Instance / Reference。
常用方法:
| 方法 | 作用 |
|---|---|
| GetFather() | 获取父 occurrence |
| ListChildren() | 获取直接子 occurrences |
| GetRelatedInstance() | occurrence -> instance |
| GetRelatedReference() | occurrence -> reference |
| ListRepChildren() | 获取直接 representation occurrences |
几个重要事实:
- Occurrence 本身没有属性。
- 属性修改要落回相关 instance/reference。
- Occurrence projection 不一定自动创建。
- 有时必须先 expand、direct open 或通过 occurrence manager 计算。
7.2 CATIPrdOccurrenceMngt
ProductStructureInterfaces/PublicInterfaces/CATIPrdOccurrenceMngt.h 是 occurrence 计算/同步服务,通过 CATPrdGetOccurrenceMngt 取得。
常用方法:
| 方法 | 作用 |
|---|---|
| GetOrCreateRootOccurrence() | root reference -> root occurrence |
| GetOccurrence() | root occurrence + path of instances -> occurrence |
| FromOccurrenceToPathOfInstances() | occurrence -> path of instances |
| Synchronize() | 根据事务事件同步 occurrence tree |
| GetRepOccurrence() | occurrence + rep instance -> rep occurrence |
| FromRepOccurrenceToPathOfInstances() | rep occurrence -> path of instances + rep instance |
推荐把装配上下文处理封装为一个服务:
Product Reference / Instance
-> root occurrence
-> path of instances
-> target occurrence
-> rep occurrence
-> CATOmbObjectInContext
这样约束、阵列、装配特征都可以复用同一套上下文构造逻辑。
8. CATOmbObjectInContext:装配 API 的通用上下文包装
ObjectModelerBase/PublicInterfaces/CATOmbObjectInContext.h 是 V6 装配模块高频对象。
它表达的是:
Object in Context = path of instances + representation instance + target object
常用方法:
| 方法 | 作用 |
|---|---|
| CreateObjectInContext() | 创建上下文对象 |
| GetPathOfInstances() | 取 path of instances |
| GetInstanceOfRepresentation() | 取 representation instance |
| GetObjectOutOfContext() | 取上下文外真实对象 |
| GetContextRootReference() | 取上下文 root PLM reference |
| Compare() | 比较两个 object in context |
装配约束、Engineering Connection、装配阵列 specification、装配特征 specification 都大量使用它。实战中不要只传 leaf geometry,因为 leaf geometry 缺少“属于哪个实例路径”的信息。
9. Engineering Connection:约束网络的容器
CATEngConnectionUseItf/PublicInterfaces/CATIEngConnectionManager.h 由 Product 实现,用来创建、列出、删除 Engineering Connection,并可计算自由度。
常用方法:
| 方法 | 作用 |
|---|---|
| ListEngConnection() | 列出产品下的 Engineering Connections |
| CreateEngConnection() | 创建 Engineering Connection |
| RemoveEngConnection() | 删除 Engineering Connection |
| ComputeDegreesOfFreedom() | 计算一阶子产品自由度 |
CreateEngConnection() 的输入 impacted 通常是 CATOmbObjectInContext 列表。头文件中有两个重要上下文规则:
- contextual impacted 的 Path of First Instances 必须以 MCX father 的 instance 结尾。
- non contextual impacted 的 Path of First Instances 必须以 MCX father 的 child instance 开头。
因此创建连接前,先把 impacted 对象的上下文整理清楚,再调用 manager。
10. Assembly Constraint:约束挂在 Engineering Connection 下
10.1 CATIAssemblyConstraintManager
CATAssemblyConstraintUseItf/PublicInterfaces/CATIAssemblyConstraintManager.h 由 Engineering Connection 实现。
常用方法:
| 方法 | 作用 |
|---|---|
| GetListOfAssemblyConstraints() | 获取 Engineering Connection 下的装配约束列表 |
| AddAssemblyConstraint() | 添加 Assembly Constraint |
| RemoveAssemblyConstraint() | 删除 Assembly Constraint |
创建约束时,几何输入是 CATOmbObjectInContext 列表,并且每个 geometry 要和 MCX impacted 一一对应。
10.2 CATIAssemblyConstraint
CATAssemblyConstraintUseItf/PublicInterfaces/CATIAssemblyConstraint.h 管单个装配约束。
它支持的类型很全,包括:
- Fix / FixTransfo
- Coincidence
- Contact
- Distance
- Angle
- Symmetry
- Parallelism / Perpendicularity
- Revolute / Prismatic / Cylindrical / Spherical / Planar / Universal
- Coupling / Roll / Slide 等
创建装配约束的推荐链路是:
选择对象
-> 解析 path of instances / rep instance / leaf geometry
-> CATOmbObjectInContext
-> CATIEngConnectionManager::CreateEngConnection
-> CATIAssemblyConstraintManager::AddAssemblyConstraint
-> update / diagnose
不要跳过 Engineering Connection,也不要把约束对象当成独立孤立 feature 处理。
11. 装配阵列:Assembly Pattern 与 Multi-Instantiation
11.1 Pattern Manager
CATAsmPatternUseItf/PublicInterfaces/CATIAssemblyUsePatternManager.h 用于创建装配阵列或多实例化。接口指明要通过 CATCreateAssemblyUsePatternManager 的 factory 方法取得 manager。
常用方法:
| 方法 | 作用 |
|---|---|
| CreatePattern() | 创建关联式 Assembly Pattern feature |
| CreateMultiInstantiation() | 只创建多个实例,不保留关联 pattern feature |
| DeletePattern() | 删除 pattern,可选择是否删除实例 |
| GetPatternList() | 列出 manager 下所有 pattern |
CreatePattern() 的输入包括:
- component:可以是
CATIPLMNavInstance或CATIPLMNavReference。 - specification:
CATOmbObjectInContext,目标可以是 Part Design pattern、GSD pattern、GS/OGS axes systems。 - specification context:可选,描述 specification 所在上下文。
- user options:例如是否创建 gathering product。
区别要记清楚:
CreatePattern()创建和 specification 关联的装配 pattern feature,规格变化会让 pattern out of date。CreateMultiInstantiation()只创建实例,不创建关联 feature。
11.2 Pattern 对象
CATAsmPatternUseItf/PublicInterfaces/CATIAssemblyUsePattern.h 管已创建的装配阵列。
常用方法:
| 方法 | 作用 |
|---|---|
| GetPatternInstances() | 获取 pattern 相关实例 |
| GetSpecification() | 获取当前 specification 和 context |
| GetParent() | 获取 parent product reference |
| ReplaceSpecification() | 替换 specification 并同步实例 |
如果业务需要“以后规格变更后同步实例数量和位置”,选 CreatePattern()。如果只需要一次性批量实例化,选 CreateMultiInstantiation()。
12. 装配特征:Assembly Feature 与 impacts
CATAsmFunctionalUseItf/PublicInterfaces/CATIAssemblyFeatureManager.h 和 CATAsmFunctionalUseItf/PublicInterfaces/CATIAssemblyFeature.h 用于装配级功能特征。
核心思路是:
Functional specification object in context
-> Assembly Feature
-> impacts on one or more Representation Occurrences
12.1 创建 Assembly Feature
CATIAssemblyFeatureManager::CreateAssemblyFeature() 输入是一个 CATOmbObjectInContext,目标对象是有效的功能 specification feature。
Manager 的常用方法:
| 方法 | 作用 |
|---|---|
| CreateAssemblyFeature() | 创建 Assembly Feature |
| ListAssemblyFeature() | 列出 manager 下所有 Assembly Feature |
| DeleteAssemblyFeature() | 删除 Assembly Feature,并先移除 impacts |
删除时有一个重要限制:被 impact 的 representations 必须可编辑;如果无法加载到 Edit mode,可能返回 E_ACCESSDENIED。
12.2 创建和删除 impacts
CATIAssemblyFeature 常用方法:
| 方法 | 作用 |
|---|---|
| CreateImpacts() | 在一个或多个 CATIPLMNavRepOccurrence 上创建 impacts |
| GetSpecification() | 获取 specification object in context |
| GetParent() | 获取 parent product reference |
| DeleteAllImpacts() | 删除所有 impacts |
| DeleteImpacts() | 删除指定 representation occurrences 上的 impacts |
CreateImpacts() 要求:
- target representations 应可编辑。
- context 和 representation occurrences 必须共享同一个 root。
- 传入的是
CATIPLMNavRepOccurrence列表,不是普通 product instance 列表。
这类接口适合做“装配级切割、连接、影响多个零件表示的功能特征”等能力。
13. Derived Representation 和装配对称
CATAssemblyUseItf 中的装配级能力相对集中在派生表示和对称对象上。
常用接口:
| 接口 | 作用 |
|---|---|
| CATIDerivedRepManager | 创建/管理 derived representation,把源 shape 的 bodies / surface sets 导入目标 shape |
| CATIAssemblySymmetryReference | 从对称生成的 reference 取原始 CATIPLMNavReference |
| CATIAssemblySymmetryInstance | 从对称生成的 instance 取原始 CATIPLMNavInstance |
| CATIAssyWorkBenchAddin | 给 Assembly Design workbench 加命令入口 |
使用 derived representation 时要注意:
- 输入通常是
CATIPLMNavRepOccurrence/CATIPLMNavRepReference。 - 源和目标 representation 需要处于可编辑或已加载状态。
- 关联导入才会创建 derived representation feature。
对称相关接口通常还涉及 ASD technical product 许可,不建议在没有确认许可和目标版本行为前作为默认方案。
14. 和自定义 feature / FeatureModelerExt 的关系
装配模块常见业务需求包括:
- 在装配树下创建业务节点。
- 给产品实例追加企业属性或检查结果。
- 基于多个零件生成装配级检查对象。
- 创建一个 specification feature,然后对多个 representation 产生 impacts。
推荐做法不是修改 OOTB product schema,而是把业务数据放到自定义 feature / applicative container 中,再用装配上下文连接起来。
可选路线:
14.1 独立装配业务 feature
AssemblyBusinessCont
AssemblyCheckRoot
AssemblyCheckItem
AssemblyCheckItem
运行时链路:
- 从
CATIPLMNavRepReference或CATIPLMNavRepOccurrence进入 applicative container。 - 用
CATFmContainerFacade绑定容器。 - 用
CATFmStartUpFacade实例化业务 feature。 - 用
CATFmFeatureFacade读写属性。 - 用导航 provider 把业务对象显示到装配树需要的位置。
14.2 装配 feature specification
如果业务 feature 要对多个零件表示产生结果,可以把自定义 feature 作为 specification,包装成 CATOmbObjectInContext 后交给 CATIAssemblyFeatureManager::CreateAssemblyFeature(),再对目标 CATIPLMNavRepOccurrence 调 CreateImpacts()。
14.3 生命周期
更新、删除和替换建议统一看:
DataCommonProtocolServices::IsUpToDate()DataCommonProtocolServices::Update()DataCommonProtocolServices::CanDelete()DataCommonProtocolServices::Delete()CATIFmFeatureBehaviorCustomization::Build()CATIFmFeatureBehaviorCustomization::CanBeRemoved()CATIFmFeatureBehaviorCustomization::BeforeRemove()
15. 推荐的开发顺序
如果要写一个稳定的 V6 装配二开命令,建议按这个顺序推进:
- 明确入口:当前 editor、当前选择、root product reference,还是 root occurrence。
- 判断当前对象是 reference、instance、occurrence 还是 representation occurrence。
- 如果要编辑产品结构,转到
CATIPLMProducts和CATIPrdObject。 - 如果要基于上下文选择创建约束或装配特征,先构造
CATOmbObjectInContext。 - 如果要访问 3D Shape 或自定义容器,通过
CATIPLMNavRepReference/CATIPLMNavRepOccurrence::RetrieveApplicativeContainer()进入。 - 如果要创建约束,先创建或找到 Engineering Connection,再在其下创建 Assembly Constraint。
- 如果要创建阵列,先确定 component、specification 和 specification context,再选择
CreatePattern()或CreateMultiInstantiation()。 - 如果要创建装配特征,先创建 specification object in context,再创建 impacts。
- 变更后执行受控 update,并记录失败诊断。
- 对删除、替换、保存、PLM Edit mode 等有副作用的操作,先做预检。
16. 常见坑
16.1 把 Occurrence 当成可编辑对象
CATIPLMNavOccurrence 的头文件明确说明 occurrence 没有自己的属性。任何编辑都要委托给对应 instance/reference。不要把 occurrence 当成可直接改名、改属性、改结构的对象。
16.2 只保存 leaf geometry,丢失装配上下文
装配约束和装配特征需要知道几何属于哪个实例路径。只保存 leaf geometry 会丢失 path of instances,导致 connector/constraint 创建失败或建到错误上下文。
16.3 遍历产品结构时同时增删子项
CATIPLMProducts::Iterator() 的头文件说明遍历时不要修改产品结构。需要修改时先收集对象,再批量处理。
16.4 Engineering Connection 的 impacted 与约束几何不匹配
CATIAssemblyConstraintManager::AddAssemblyConstraint() 要求每个 geometry 和 MCX impacted 一一对应,并满足 Path of First Instances 规则。输入列表顺序和上下文都要严格检查。
16.5 Assembly Feature impact 目标不可编辑
CATIAssemblyFeature::CreateImpacts() 和删除 impacts 都要求目标 representation 可编辑,或能加载到 Edit mode。否则可能返回 E_ACCESSDENIED 且不做任何动作。
16.6 CreatePattern 和 CreateMultiInstantiation 混用
CreatePattern() 会创建关联 feature;CreateMultiInstantiation() 不会。业务要求后续同步时必须选前者,一次性时才选后者。
17. 验证清单
开发完一个装配能力后,至少验证下面几类数据:
- 空装配:能否取得 root reference / root occurrence。
- 多层装配:path of instances 是否正确。
- 同一 reference 多实例:能否区分不同 occurrence。
- 带 representation 的产品:能否取得 rep instance / rep occurrence / applicative container。
- 装配约束:Engineering Connection、impacted、geometry 是否一一对应。
- 装配阵列:关联 pattern 和 multi-instantiation 的行为是否符合预期。
- 装配特征:impacts 是否只创建在目标 rep occurrences 上。
- 目标 representation 不可编辑时:是否有清晰失败报告,不留下半成品。
- 删除场景:是否先预检再删除,且能按需删除 impacts / pattern instances。
- 关闭重开后:context、occurrence、业务 feature 是否仍能恢复。
18. 最小接口记忆表
如果只记一张表,可以先记下面这些:
| 场景 | 优先接口 |
|---|---|
| 产品结构增删改查 | CATIPLMProducts |
| Reference / Instance / 父子关系 | CATIPrdObject |
| Root occurrence 和 path 转换 | CATIPrdOccurrenceMngt |
| 装配上下文投影 | CATIPLMNavOccurrence |
| 表示上下文投影 | CATIPLMNavRepOccurrence |
| 上下文对象包装 | CATOmbObjectInContext |
| 创建 Engineering Connection | CATIEngConnectionManager |
| 创建装配约束 | CATIAssemblyConstraintManager / CATIAssemblyConstraint |
| 创建装配阵列 | CATIAssemblyUsePatternManager |
| 管理装配阵列 | CATIAssemblyUsePattern |
| 创建装配特征 | CATIAssemblyFeatureManager |
| 创建 impacts | CATIAssemblyFeature |
| 进入 3D Shape / 自定义容器 | CATIPLMNavRepReference / CATIPLMNavRepOccurrence::RetrieveApplicativeContainer() |
| 更新/删除 | DataCommonProtocolServices |
| 自定义业务 feature | FeatureModelerExt |
评论