PLM之家精品课程培训,联系电话:18301858168 QQ: 939801026

  • NX二次开培训

    NX二次开培训

    适合初级入门或想深入了解二次开发的工程师,本培训结合ufun,NXOpen C++,大量的实例及官方内部的开发技术对于老鸟也值得借鉴!.

    NX CAM二次开发培训报名 NX二次开发基础培训报名
  • PLM之家Catia CAA二次开发培训

    Catia二次开发培训

    Catia二次开发的市场大,这方面开发人才少,难度大。所以只要你掌握了开发,那么潜力巨大,随着时间的积累,你必将有所用武之地!

  • PLM之Teamcenter最佳学习方案

    Teamcenter培训

    用户应用基础培训,管理员基础培训,管理员高级培训,二次开发培训应有尽有,只要你感兴趣肯学习,专业多年经验大师级打造!

  • PLM之Tecnomatix制造领域培训

    Tecnomatix培训

    想了解制造领域数字化吗?想了解工厂,生产线设计吗?数字化双胞胎,工业4.0吗?我们的课程虚位以待!

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

[二次开发源码] NX二次开发源码分享:NXOpen C++创建圆柱体特征

[复制链接]

2013-11-4 12:06:33 3737 0

admin 发表于 2013-11-4 12:06:33 |阅读模式

admin 楼主

2013-11-4 12:06:33

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

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

x
NX二次开发源码分享:NXOpen C++创建圆柱体特征
7 h" k9 |) Z" E; p, ]2 G$ N  U

  1. 4 g# D& g4 Q. _1 d1 p
  2. <P> </P>
复制代码
  1. 9 ~+ n) B/ Y/ u
  2. <P>void CreateCylinder_UsingUDB::CreateCylinder()
    1 F3 C1 w' s5 i3 ]  ^
  3. {
    8 z6 }% {0 w3 }0 p5 E  x
  4. Part* workPart(theSession->Parts()->Work());</P>
    * m: x" y; j: M# W/ O- Q
  5. <P>Features::CylinderBuilder* cylinderBuilder1 = NULL;, V, K, G+ F2 W7 a$ w
  6. cylinderBuilder1 = workPart->Features()->CreateCylinderBuilder(NULL);</P>- `. v( G4 o& T; |6 u7 N5 `
  7. <P>//Get the point
    + R! C1 v6 m. k' H( j4 }0 H- n! @- _
  8. PropertyList* pointPropertyList = point0->GetProperties();3 O& P; i, y7 @% U# x4 D0 `
  9. Point3d originPoint = pointPropertyList->GetPoint("Point");  V5 a% z0 a8 n5 j! L/ G+ ]0 y
  10. delete pointPropertyList;
    5 ^% m6 A1 J8 Y3 d8 q- I
  11. pointPropertyList = NULL;</P>
    / A" I* z6 `, [# M6 R
  12. <P>//Get the direction
    9 x2 R: P$ N8 V, B* J9 w* t
  13. PropertyList* vectorPropertyList = vector0->GetProperties();& T9 R" f% j8 L; I0 J
  14. Vector3d direction = vectorPropertyList->GetVector("Vector");7 P$ R5 m6 o- p) D5 p
  15. delete vectorPropertyList;* s" ~; N& z4 c2 M" |
  16. vectorPropertyList = NULL;</P>9 s/ J) X& O, V$ p% c4 A% u
  17. <P>Direction* direction1 = NULL;
    ) w) c( b1 s6 Z9 N% ^4 N
  18. direction1 = workPart->Directions()->CreateDirection(originPoint, direction, SmartObject::UpdateOptionWithinModeling);</P>  ~' Q/ c7 C7 ~# K. Y! o: R- J2 Y
  19. <P>//Set diameter and height1 U3 J$ l0 y8 F
  20. std::stringstream diameterValue;
    : o1 A  ~5 A, x+ ]$ r$ C
  21. diameterValue << diameter->GetValue();
    5 O8 Z! [% g: S2 w
  22. std::stringstream heightValue;8 i2 W0 e$ B* n
  23. heightValue << height->GetValue();</P>
    1 O! S& I6 }) g; q+ `4 t4 }
  24. <P>cylinderBuilder1->Diameter()->SetRightHandSide(diameterValue.str());
    0 T; l1 E( V: g6 y/ y0 a
  25. cylinderBuilder1->Height()->SetRightHandSide(heightValue.str());</P>
    7 o3 i3 y7 y! h: K, g. l0 x' L* X* @  j
  26. <P>//Set the axis3 w( `8 L+ W; Q$ E# F' G
  27. Axis* axis1 = NULL;. E4 ~9 b) X+ r% u3 L
  28. axis1 = cylinderBuilder1->Axis();2 J3 i" U! a9 x) ]
  29. axis1->Point()->SeTCoordinates(originPoint);: {# ?7 c" Z  g
  30. axis1->SetDirection(direction1);</P>8 r( v8 o, a# ?4 v5 {" p! Q2 ~
  31. <P>//Commit8 c/ i3 M$ _& }+ {4 H- L
  32. cylinderBuilder1->Commit();* {" p4 X3 [: K0 |8 @7 i
  33. cylinderBuilder1->Destroy();9 Z- O: C% o' n4 u) @/ |- [' M5 H. u
  34. cylinderBuilder1 = NULL;& K4 ?2 I8 [; K8 V+ D( {% f1 B
  35. }
    - x; L0 @# m! ], u9 m5 ^2 z
  36. </P>
复制代码
" S& E$ H# a* K) i) @+ i
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 www.diantuankj.com/ doTeam.tech
回复

使用道具 举报

发表回复

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

返回列表 本版积分规则

  • 发布新帖

  • 在线客服

  • 微信

  • 客户端

  • 返回顶部

  • x
    温馨提示

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

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

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

    我知道了