查看: 4613|回复: 1

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

[复制链接]

4

主题

3

回帖

48

积分

管理员

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

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

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

×
PLM之家NX二次开发自动装配项目】1.6 创建固定约束: l% |! B3 n2 t- E7 Z
装配约束的创建过程,如何创建一个对象的约束为固定约束!9 E4 K( f6 \6 G8 |, s

( ^* z3 g& V+ y$ a2 h

1 N) n( n2 q1 k1 k4 V. X  a, g# T6 V" N* c" G/ |
// 创建固定约束
, M& m/ {/ Y/ F8 n+ T; `3 T$ S, B- J. K: T0 [

1 b3 D2 [# T+ S$ y        Positioning::ComponentPositioner *componentPositioner1;
% s1 G# {6 Y! X$ U' o        componentPositioner1 = workPart->ComponentAssembly()->Positioner();
, E& v6 Q0 q4 _% i        componentPositioner1->ClearNetwork();' `/ Y3 v$ a5 p6 l1 K- l/ C% I
        componentPositioner1->BeginAssemblyConstraints();
$ Q$ E$ H0 v: z0 D# q* F2 ~        Positioning::Network *network1;
2 B; S" `1 y) b) v1 w        network1 = componentPositioner1->EstablishNetwork();
, L+ Z4 F) R; g        Positioning::ComponentNetwork *componentNetwork1(dynamic_cast<Positioning::ComponentNetwork *>(network1));2 j/ I- I  }+ k6 {7 ?; y
        componentNetwork1->SetMoveObjectsState(true);' d8 n4 [7 k6 U- P
        Assemblies::Component *nullAssemblies_Component(NULL);
  X6 A% s. U. N6 j+ o) P" W1 G        componentNetwork1->SetDisplayComponent(nullAssemblies_Component);
( A9 K2 O0 K2 j9 m+ i, P) d        componentNetwork1->SetNetworkArrangementsMode(Positioning::ComponentNetwork::ArrangementsModeExisting);
$ v' d- C* U2 P( k* j        Positioning::Constraint *constraint1;
  l& Z3 f8 ?* r        constraint1 = componentPositioner1->CreateConstraint(true);
1 x# @2 M7 o2 `! ~, n        Positioning::ComponenTConstraint *componentConstraint1(dynamic_cast<Positioning::ComponentConstraint *>(constraint1));" V2 n$ S  O) P5 E9 d, h% X
        componentConstraint1->SetConstraintType(Positioning::Constraint::TypeFix);& |) t" b7 ]/ b) i
        Positioning::ConstraintReference *constraintReference1;! w+ K. K- j# A9 u! y$ c
        constraintReference1 = componentConstraint1->CreateConstraintReference(component1, component1, false, false, false);) [2 N3 I+ T) A5 Z0 P
        Point3d helpPoint1(0, 0, 0);
, g* z  \. v0 ]& ]        constraintReference1->SetHelpPoint(helpPoint1);% B9 y! D( f* F% n1 g+ \1 |" {
        componentNetwork1->Solve();; P: w: i5 J  n9 h
        componentPositioner1->ClearNetwork();
0 H$ j0 L+ J7 L        componentPositioner1->DeleteNonPersistentConstraints();% g* {( q) r2 L
        Assemblies::Arrangement *nullAssemblies_Arrangement(NULL);7 o2 y' V* z3 V; N
        componentPositioner1->SetPrimaryArrangement(nullAssemblies_Arrangement);
/ ?8 f+ x" T' Y3 t$ {        componentPositioner1->EndAssemblyConstraints();% k: `8 i7 q5 _# B

/ W$ _+ D: c. }' w0 J
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.doteam.tech
回复

使用道具 举报

4

主题

3

回帖

48

积分

管理员

积分
48
 楼主| 发表于 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客服返回顶部