请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
×
【PLM之家NX二次开发自动装配项目】1.2 装配相关开发类说明4 S& i R( L( V |8 [ C% ~
: A2 J" n) a4 B3 ?. B( ^* J% }& W" u2 l/ `7 `2 Q
NXOpen API 应 用 Assemblies::Component 类 来 表 示组 件 对 象 , 通 过 Assemblies::ComponentAssembly 类对象实现对 Component 对象的遍历、添加、定位等管理。 (1) 装配组件树结构 装配部件通过树型结构来管理所包含的所有组件,开发人员可以通过 Part 对象的 ComponentAssembly方法得到该 Part 对象的 Assemblies::ComponentAssembly 实例。然后通过 方 法 Assemblies::ComponentAssembly::Roo TComponent 可 以 得 到 该 装 配 组 件 树 的Component 根节点对象。 (2) 装配组件添加 通过方法 Assemblies::ComponentAssembly::AddComponent实现在装配部件中添加新组件。 (3) 装配组件移动 通过方法 Assemblies::ComponentAssembly::MoveComponent实现在该装配部件中移动组件。 (4) 装配组件遍历 通过方法 Assemblies::Component::GetChildren 可以得到该组件下的所有组件子节点;通过方法 Assemblies::Component::Parent 可以得到该组件直接属于的组件父节点;通过方法Assemblies::Component::DirectOwner可 以 得 到 该 组 件 所 直 接 属 于 的 装 配 树 结构 对 象(ComponentAssembly)。 (5) 装配约束 通过NXOpen::Positioning实现装配约束的创建
' h' @, g1 J! ]
$ h: M* i) \5 [1 f* q# m |