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 3634 0

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

admin 楼主

2013-11-4 12:06:33

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

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

x
NX二次开发源码分享:NXOpen C++创建圆柱体特征& A4 l5 f0 \/ `2 {/ p

  1. ! {2 z! ^1 y$ ?9 {9 a8 `
  2. <P> </P>
复制代码

  1. 7 l. H: i' O# I2 w6 u/ d( `
  2. <P>void CreateCylinder_UsingUDB::CreateCylinder()
    " |; L. }; P7 Q* _$ ?: L
  3. {/ [% m# [0 ~7 W5 B8 }' t7 _9 B
  4. Part* workPart(theSession->Parts()->Work());</P>1 t0 i! c$ H+ q
  5. <P>Features::CylinderBuilder* cylinderBuilder1 = NULL;
    . e/ y) ~) y- {
  6. cylinderBuilder1 = workPart->Features()->CreateCylinderBuilder(NULL);</P>( s9 A6 e9 T( v3 @4 E" J* ?0 z
  7. <P>//Get the point) D5 D: Z; N- I" z, \) U! ]
  8. PropertyList* pointPropertyList = point0->GetProperties();: I% }& A( h, v7 R
  9. Point3d originPoint = pointPropertyList->GetPoint("Point");# G: }' O2 e$ D" B
  10. delete pointPropertyList;/ n; s+ Q  e$ m
  11. pointPropertyList = NULL;</P>
    4 K$ T7 N0 j5 ~3 D: L3 u
  12. <P>//Get the direction
    3 O! O. z6 Q3 q+ H$ n9 W
  13. PropertyList* vectorPropertyList = vector0->GetProperties();
    0 ]3 \& P' i) {! I. n
  14. Vector3d direction = vectorPropertyList->GetVector("Vector");
    7 J2 |" ]0 Y$ O3 D1 n% j6 `
  15. delete vectorPropertyList;
    * Y" N- ?6 N1 z5 o2 Y
  16. vectorPropertyList = NULL;</P>+ z3 k$ A9 v) j9 G# f
  17. <P>Direction* direction1 = NULL;% x' ~( k2 F, c3 I/ A
  18. direction1 = workPart->Directions()->CreateDirection(originPoint, direction, SmartObject::UpdateOptionWithinModeling);</P>
    & m# s7 B5 b8 |* O! ^+ d
  19. <P>//Set diameter and height
    3 u9 D) [2 A! q9 D, Z
  20. std::stringstream diameterValue;' O6 [2 J4 a/ ?0 S
  21. diameterValue << diameter->GetValue();
    5 c- N+ A4 u8 b' O- _- s/ n* {
  22. std::stringstream heightValue;3 b/ y/ |7 B# Z& y- J
  23. heightValue << height->GetValue();</P>2 q: N5 I& {: Y6 s& m
  24. <P>cylinderBuilder1->Diameter()->SetRightHandSide(diameterValue.str());# |9 ~/ I( z6 N3 \7 g3 K1 L
  25. cylinderBuilder1->Height()->SetRightHandSide(heightValue.str());</P>
    / |' l  ?* S, v
  26. <P>//Set the axis
    " V9 F8 N# d5 h5 K% c5 ]# j
  27. Axis* axis1 = NULL;  B) @# K5 `* e6 X( u3 H6 U+ U
  28. axis1 = cylinderBuilder1->Axis();
    . {/ I* {, f1 K6 S% a
  29. axis1->Point()->SeTCoordinates(originPoint);' |4 L! W  |' r- Q
  30. axis1->SetDirection(direction1);</P>" e, n! f6 I: Y
  31. <P>//Commit, F( A, h" C) ?: |3 Y
  32. cylinderBuilder1->Commit();( V1 ?" y4 |" o. F1 L2 m" F' {! j
  33. cylinderBuilder1->Destroy();
    " i& Y8 u6 e4 U  j% e( ~. w
  34. cylinderBuilder1 = NULL;# h7 [6 L/ e) h* ]! k0 V  C+ }
  35. }- F1 ?- ~5 S# @: R
  36. </P>
复制代码
. C7 C2 E% K' \+ y+ N! f  m3 |
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了