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

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

admin 楼主

2013-11-4 12:06:33

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

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

x
NX二次开发源码分享:NXOpen C++创建圆柱体特征5 O# j& u* E+ [  \5 Z: {
  1. 2 ?6 ?8 X) E2 r, F
  2. <P> </P>
复制代码
  1. 9 C* C0 j: d8 `% b+ E
  2. <P>void CreateCylinder_UsingUDB::CreateCylinder()
    & [( o- E+ L) o& k, S
  3. {
    : b6 e3 b6 l6 ~. w, s' X# G
  4. Part* workPart(theSession->Parts()->Work());</P>8 z! \& ], a7 O* X! E$ K
  5. <P>Features::CylinderBuilder* cylinderBuilder1 = NULL;
    % W2 v# t7 m2 T0 j# T( J- h
  6. cylinderBuilder1 = workPart->Features()->CreateCylinderBuilder(NULL);</P>* o7 r, s$ w0 m' Z! J$ }
  7. <P>//Get the point
    8 K8 G  c% C: ^; g+ X. h
  8. PropertyList* pointPropertyList = point0->GetProperties();- W7 t( R- V3 C
  9. Point3d originPoint = pointPropertyList->GetPoint("Point");$ D, Q, q  m! c  z
  10. delete pointPropertyList;. E! N6 _- C! q$ o7 E' ?, @/ V
  11. pointPropertyList = NULL;</P>
    ' f; h- [; L; E1 }0 _# |- O, g: C
  12. <P>//Get the direction
    2 w6 z0 `0 {5 M+ M' C1 d
  13. PropertyList* vectorPropertyList = vector0->GetProperties();2 C$ ~( L& ^& G/ {
  14. Vector3d direction = vectorPropertyList->GetVector("Vector");
      P0 G" \" m) t; ?+ e1 @& V6 J
  15. delete vectorPropertyList;) M# M2 w' T" k! k) Y- [
  16. vectorPropertyList = NULL;</P>1 z1 o  n' X2 R3 y* [& G
  17. <P>Direction* direction1 = NULL;) P! \  I# s! O: J( \: d
  18. direction1 = workPart->Directions()->CreateDirection(originPoint, direction, SmartObject::UpdateOptionWithinModeling);</P>
    & a# ~* G# Y2 u4 l2 ]) `' n
  19. <P>//Set diameter and height
    3 I  H8 A( D( \
  20. std::stringstream diameterValue;5 }3 O4 h) ?* F2 v  A) z9 `7 K$ n
  21. diameterValue << diameter->GetValue();& _7 m" A+ f/ t* m7 V/ Q# F! l  @3 m
  22. std::stringstream heightValue;4 \# Z& K; X" w8 |0 G2 L# n
  23. heightValue << height->GetValue();</P>! X& t9 G9 P, a% n7 o" t) Q5 K$ t
  24. <P>cylinderBuilder1->Diameter()->SetRightHandSide(diameterValue.str());
    , t! G/ w1 u8 \$ h& M' D8 K* ~
  25. cylinderBuilder1->Height()->SetRightHandSide(heightValue.str());</P>$ X/ h3 [: D! \6 Z
  26. <P>//Set the axis
    7 g, ]! o; I) t: {
  27. Axis* axis1 = NULL;
    , L$ L+ E4 t' e: }/ J1 p9 w/ J
  28. axis1 = cylinderBuilder1->Axis();
    ! X2 ]! {7 t7 E
  29. axis1->Point()->SeTCoordinates(originPoint);% n3 e8 M9 p0 U# q* A2 P
  30. axis1->SetDirection(direction1);</P>( ]# p; [; U7 z$ X1 J
  31. <P>//Commit
    ! c( K8 r) F( E. v, N# }1 Z
  32. cylinderBuilder1->Commit();# C' s4 I& S; k' o, I/ L) E4 c
  33. cylinderBuilder1->Destroy();1 ~2 P: R' q* Q( G6 _  w
  34. cylinderBuilder1 = NULL;
    $ J9 }! q1 _& v/ \9 L
  35. }
    * g  b2 G1 [7 Q8 l$ M) |6 y9 d9 o
  36. </P>
复制代码

- b# @. [$ d5 z: E
上海点团信息科技有限公司,承接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二次开发专题模块培训报名开始啦

    我知道了