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

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

admin 楼主

2013-11-4 12:06:33

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

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

x
NX二次开发源码分享:NXOpen C++创建圆柱体特征
7 v; k+ c" l& @" ^6 |5 v) W5 x
  1. ' T/ K8 ]9 m; R
  2. <P> </P>
复制代码
  1. 7 v" t' p" g0 Q* e' u; U7 o
  2. <P>void CreateCylinder_UsingUDB::CreateCylinder()
    " E* r4 B* E5 G7 Q, S
  3. {
    % v0 l$ H4 {$ G# n( \) S
  4. Part* workPart(theSession->Parts()->Work());</P>
    1 U1 N: j. X! f/ ]  a8 W/ E0 K
  5. <P>Features::CylinderBuilder* cylinderBuilder1 = NULL;  k' C9 y# D5 @! @6 C
  6. cylinderBuilder1 = workPart->Features()->CreateCylinderBuilder(NULL);</P>
    # h3 ]5 g, |5 }: z3 X9 N
  7. <P>//Get the point# p* ]/ f; L$ S7 \+ ?
  8. PropertyList* pointPropertyList = point0->GetProperties();
    1 K4 n# g# C6 v2 `; P
  9. Point3d originPoint = pointPropertyList->GetPoint("Point");
    / T+ {. `) n6 P& Q6 J+ E
  10. delete pointPropertyList;4 }6 `2 L9 {5 \( {4 Q
  11. pointPropertyList = NULL;</P>
    + K+ p- @; U" P: P
  12. <P>//Get the direction
      R& m5 @4 ^! l
  13. PropertyList* vectorPropertyList = vector0->GetProperties();; Y/ i: X2 S: V' T" R
  14. Vector3d direction = vectorPropertyList->GetVector("Vector");
    0 ?1 B/ n/ T+ g) r& w
  15. delete vectorPropertyList;1 H* s  ?/ s, |* c$ K+ k- t9 Q
  16. vectorPropertyList = NULL;</P>( v$ M4 k9 G1 Y* p5 v, d
  17. <P>Direction* direction1 = NULL;
    " S, m" t0 m3 b! \
  18. direction1 = workPart->Directions()->CreateDirection(originPoint, direction, SmartObject::UpdateOptionWithinModeling);</P>7 n4 k' c4 c6 q( v# G2 }
  19. <P>//Set diameter and height
    8 `3 V- g, B, k* L  V% a7 ]
  20. std::stringstream diameterValue;5 ?1 y/ a# G: i0 b0 }, j
  21. diameterValue << diameter->GetValue();
    , P8 b4 ]9 T& \9 T" J& t
  22. std::stringstream heightValue;% H2 t! k2 {- [3 t" u& M5 _
  23. heightValue << height->GetValue();</P>
    8 r0 R9 ?; m+ s9 u  ]! T
  24. <P>cylinderBuilder1->Diameter()->SetRightHandSide(diameterValue.str());# ], L9 c4 p, F) \3 R2 `; h) ]: r
  25. cylinderBuilder1->Height()->SetRightHandSide(heightValue.str());</P>
    1 h7 O+ a( f9 M$ l& g/ f6 _/ I
  26. <P>//Set the axis5 r/ b* V7 K; t  |
  27. Axis* axis1 = NULL;+ w! }) L7 n1 H0 @
  28. axis1 = cylinderBuilder1->Axis();
    & h8 ]) _! c3 T( q' c- J% U
  29. axis1->Point()->SeTCoordinates(originPoint);/ N( M; S0 F1 ^' p. |& V
  30. axis1->SetDirection(direction1);</P>3 Y- [4 K( m0 V5 |
  31. <P>//Commit
    ( j- S+ A! @# u% I0 T& o
  32. cylinderBuilder1->Commit();4 T3 ?2 }+ I6 q9 j+ \4 E, @
  33. cylinderBuilder1->Destroy();
    0 d: F/ y7 G/ H+ f. E% Q' t
  34. cylinderBuilder1 = NULL;% ]" u3 L) l* {0 o! x# k
  35. }
    2 w% l& r3 L/ E  [$ s4 s* r' q: L
  36. </P>
复制代码
+ W! R' X  W* e( l# j
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了