PLM之家PLMHome-国产软件践行者

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

[复制链接]

2015-1-30 23:20:00 4354 1

admin 发表于 2015-1-30 23:19:45 |阅读模式

admin 楼主

2015-1-30 23:19:45

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

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

x
PLM之家NX二次开发自动装配项目】1.6 创建固定约束2 I6 _7 O9 e6 P& ?% [& S
装配约束的创建过程,如何创建一个对象的约束为固定约束!2 f5 h/ K0 E  m0 u/ T7 j2 g% P
+ q! i1 r0 u9 J1 l

6 I5 [& S1 A' P! J5 I: W7 ~# z$ ^+ {6 g! [* ?7 a0 `$ `
// 创建固定约束
# i1 G, }( z. Z3 W' h' O3 H3 ^: T* @' r5 h" @' Y0 o2 b! @9 T

& n, K( L* v- I7 `- F: @1 Y8 Y3 j        Positioning::ComponentPositioner *componentPositioner1;" h8 g+ H' e! u7 x. Y: u
        componentPositioner1 = workPart->ComponentAssembly()->Positioner();
9 h) f* U) d9 V' S/ l        componentPositioner1->ClearNetwork();" B. L; J2 y) ^  [3 X- [
        componentPositioner1->BeginAssemblyConstraints();! e6 ?1 N+ G" L  Y. f
        Positioning::Network *network1;) ~, A& a' y7 i2 K9 l
        network1 = componentPositioner1->EstablishNetwork();% P% |; W: `1 b+ j7 {/ Q, j
        Positioning::ComponentNetwork *componentNetwork1(dynamic_cast<Positioning::ComponentNetwork *>(network1));/ s+ C/ G! |7 L( T# [
        componentNetwork1->SetMoveObjectsState(true);
2 U9 O! b3 P. H7 Z! w/ ]        Assemblies::Component *nullAssemblies_Component(NULL);
6 p/ ?* L( }# U6 Y        componentNetwork1->SetDisplayComponent(nullAssemblies_Component);
, Z' W8 M* m) y# T; ?9 l        componentNetwork1->SetNetworkArrangementsMode(Positioning::ComponentNetwork::ArrangementsModeExisting);
2 X0 i9 I/ u6 j9 D& r        Positioning::Constraint *constraint1;" B+ }! p$ ]3 P& V* `. `7 S
        constraint1 = componentPositioner1->CreateConstraint(true);' I3 ~% f& B, x7 l7 }
        Positioning::ComponenTConstraint *componentConstraint1(dynamic_cast<Positioning::ComponentConstraint *>(constraint1));
0 i2 R' j3 Y: R) ~        componentConstraint1->SetConstraintType(Positioning::Constraint::TypeFix);0 u( I3 l% B0 k; \
        Positioning::ConstraintReference *constraintReference1;
$ X/ e. c$ G% {; ]        constraintReference1 = componentConstraint1->CreateConstraintReference(component1, component1, false, false, false);9 j5 U% J. y* ?- L  K8 m, z; H0 M3 N
        Point3d helpPoint1(0, 0, 0);
* W5 b2 n* C- G6 G$ }4 n/ |        constraintReference1->SetHelpPoint(helpPoint1);
- j" B7 d. |$ s6 V/ u: O        componentNetwork1->Solve();
, W0 V4 t+ i% I2 m+ @! u8 ?        componentPositioner1->ClearNetwork();
% B1 d/ d- o4 Z8 K        componentPositioner1->DeleteNonPersistentConstraints();
; N. |# e" J( g5 r* N. |        Assemblies::Arrangement *nullAssemblies_Arrangement(NULL);! I, h' G0 D0 q. A, Q
        componentPositioner1->SetPrimaryArrangement(nullAssemblies_Arrangement);) Y, G8 `2 B- _1 Y7 K* H/ X
        componentPositioner1->EndAssemblyConstraints();+ E/ X$ e% ?( [; K* s0 s  n

  F* l0 q, [: `
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复

使用道具 举报

全部回复1

admin 发表于 2015-1-30 23:20:00

admin 沙发

2015-1-30 23:20:00

培训VIP可见
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复 支持 反对

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

    本网站(plmhome.com)为PLM之家工业软件学习官网站

    展示的视频材料全部免费,需要高清和特殊技术支持请联系 QQ: 939801026

    PLM之家NX CAM二次开发专题模块培训报名开始啦

    我知道了