查看: 4571|回复: 1

[原创视频] 【PLM之家NX二次开发自动装配项目】1.6 创建固定约束

[复制链接]

4

主题

3

回帖

44

积分

管理员

积分
44
发表于 2015-1-30 23:19:45 | 显示全部楼层 |阅读模式

请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!

您需要 登录 才可以下载或查看,没有账号?注册

×
PLM之家NX二次开发自动装配项目】1.6 创建固定约束' i; O0 f4 T& l7 v
装配约束的创建过程,如何创建一个对象的约束为固定约束!
& H* X7 B1 N! T1 n9 N# T
: J: o  ^9 @! I7 p
. a. f+ D' t  w, H! z2 }: ~
: u5 O' z# f% [0 [. c. w
// 创建固定约束8 G. {) O4 }  i! l4 O- X0 I4 i
4 R# m* l8 O$ P! O4 P4 m  H

- T2 a6 c$ g1 N, _' u" k3 ?        Positioning::ComponentPositioner *componentPositioner1;
8 q% W4 j. j$ y/ N3 F        componentPositioner1 = workPart->ComponentAssembly()->Positioner();8 Q. f9 U; I& e" J
        componentPositioner1->ClearNetwork();
1 n2 [; {! A: e1 [4 o        componentPositioner1->BeginAssemblyConstraints();
- N- P5 r' R+ ]' X4 `        Positioning::Network *network1;
1 w. N; }% h1 E1 D/ ?% Y+ W        network1 = componentPositioner1->EstablishNetwork();
* h1 I! m; V% c5 a! h3 ~        Positioning::ComponentNetwork *componentNetwork1(dynamic_cast<Positioning::ComponentNetwork *>(network1));$ U% @0 r8 K7 |- w% u
        componentNetwork1->SetMoveObjectsState(true);3 R- o" n! K$ C* B4 J3 ]6 Q
        Assemblies::Component *nullAssemblies_Component(NULL);9 v" a. H, V7 J' r4 U
        componentNetwork1->SetDisplayComponent(nullAssemblies_Component);' p- P1 |: t7 Q* J
        componentNetwork1->SetNetworkArrangementsMode(Positioning::ComponentNetwork::ArrangementsModeExisting);
3 c+ O% P- m% f        Positioning::Constraint *constraint1;
/ ^3 R) _' x5 T0 l        constraint1 = componentPositioner1->CreateConstraint(true);
- I+ `1 z4 u6 M& M* l        Positioning::ComponenTConstraint *componentConstraint1(dynamic_cast<Positioning::ComponentConstraint *>(constraint1));
4 ]4 l* d( y* m        componentConstraint1->SetConstraintType(Positioning::Constraint::TypeFix);
. \% [' m. f1 \5 E/ o        Positioning::ConstraintReference *constraintReference1;
, V9 T3 U' B- f' O/ v/ x        constraintReference1 = componentConstraint1->CreateConstraintReference(component1, component1, false, false, false);! x# R. X; Q# {$ W
        Point3d helpPoint1(0, 0, 0);6 x5 j# J1 w/ g1 @
        constraintReference1->SetHelpPoint(helpPoint1);
% u/ n3 u6 M% b. `        componentNetwork1->Solve();8 ~% f( n$ g' k2 Q
        componentPositioner1->ClearNetwork();
  e$ K& I" J$ ~. F* H  s* z        componentPositioner1->DeleteNonPersistentConstraints();
" Z. ?" ?# k$ i" {# z" r/ ^* [        Assemblies::Arrangement *nullAssemblies_Arrangement(NULL);
5 O+ q! ]& K/ D; U* }% s        componentPositioner1->SetPrimaryArrangement(nullAssemblies_Arrangement);* R1 s9 \9 Q! G! h  s
        componentPositioner1->EndAssemblyConstraints();0 J3 t8 p9 u6 p# I  X
  y( e+ A8 B4 E) N* h" |/ i
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复

使用道具 举报

4

主题

3

回帖

44

积分

管理员

积分
44
 楼主| 发表于 2015-1-30 23:20:00 | 显示全部楼层
培训VIP可见
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

在本版发帖
关注公众号
QQ客服返回顶部