NX插件
送教程
DoTeam
培训报名
AI · CAD · PLM
首页
Portal
社区
论坛
NX技术
TC技术
Catia技术
自研系统
更多
登录
NX Toolkits 「PLM之家插件」
Castsim「铸造PLM系统」
EchoCAD「大模型CAD」
视频在线
实践教程
前沿咨询
高清购买
国产软件
PLM之家PLMHome-工业软件践行者,大模型驱动工业生态建设
»
社区
›
工业4.0产品数字化-Siemens NX/UG学习论坛
›
Simens NX二次开发专区
›
NX二次开发源码分享:NXOpen C++创建圆柱体特征 ...
返回列表
发新帖
查看:
4262
|
回复:
0
[二次开发源码]
NX二次开发源码分享:NXOpen C++创建圆柱体特征
[复制链接]
admin
admin
当前离线
积分
82265
2477
主题
1280
回帖
8万
积分
管理员
PLM之家站长
积分
82265
发消息
发表于 2013-11-4 12:06:33
|
显示全部楼层
|
阅读模式
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要
登录
才可以下载或查看,没有账号?
注册
×
NX二次开发
源码分享:
NX
Open C++创建圆柱体特征
+ \( h. l7 I& F5 R/ [ ?2 t3 U$ I4 z! J
$ H1 J9 C# [ |& J7 E7 `5 z( g
<P> </P>
复制代码
' ]( \: f8 }/ w9 h0 _' }
<P>void CreateCylinder_UsingUDB::CreateCylinder()
# C# J. t3 m& B- {. d
{
7 I& y6 B2 S! m' K* f
Part* workPart(theSession->Parts()->Work());</P>
5 B0 h$ [+ `' m. ]+ l3 V3 T0 e: C
<P>Features::CylinderBuilder* cylinderBuilder1 = NULL;
2 ^% L6 n* K9 i8 C1 r+ g
cylinderBuilder1 = workPart->Features()->CreateCylinderBuilder(NULL);</P>
3 j2 m Q$ y# a. l$ O; e- g" ]
<P>//Get the point
# p) l- k: T7 M1 U* N f; m. |7 T
PropertyList* pointPropertyList = point0->GetProperties();
5 O+ ?- e4 f3 A8 l3 w( L7 n
Point3d originPoint = pointPropertyList->GetPoint("Point");
3 r$ t" U! ^( i: ]7 v
delete pointPropertyList;
/ z U1 ?/ n6 ~' B. h
pointPropertyList = NULL;</P>
: k& h8 r6 c6 G
<P>//Get the direction
7 r7 M B5 Y4 K$ G* p j2 l
PropertyList* vectorPropertyList = vector0->GetProperties();
& |- B- e& H& l7 v* S
Vector3d direction = vectorPropertyList->GetVector("Vector");
/ I6 p, O; C8 Z: E0 j9 p6 X: Y
delete vectorPropertyList;
- I, V3 {7 o7 a+ u1 @6 A
vectorPropertyList = NULL;</P>
- O1 T; F% w* k6 Y0 y
<P>Direction* direction1 = NULL;
Q! W1 @% P2 U+ K, u- R4 g) z& l# G
direction1 = workPart->Directions()->CreateDirection(originPoint, direction, SmartObject::UpdateOptionWithinModeling);</P>
& R* d+ x+ J/ [+ d" m$ N9 f
<P>//Set diameter and height
3 i$ k, I, g4 _. h
std::stringstream diameterValue;
/ ]: ]7 \# z( o9 Q# t$ z
diameterValue << diameter->GetValue();
1 R3 y: J3 w. L! _7 F( x! h8 G+ D
std::stringstream heightValue;
2 q% D( M: s9 V2 O/ R$ M2 |
heightValue << height->GetValue();</P>
) M5 B1 j% x6 n1 r6 i; B
<P>cylinderBuilder1->Diameter()->SetRightHandSide(diameterValue.str());
Z6 x/ ]& _4 m+ x
cylinderBuilder1->Height()->SetRightHandSide(heightValue.str());</P>
; N+ Q- Y# ]. L# T5 r! s/ K9 n
<P>//Set the axis
$ m% Z" x, L1 u9 _6 |
Axis* axis1 = NULL;
6 Y; h% L w H1 |; z
axis1 = cylinderBuilder1->Axis();
) I# w6 q6 f: s- v$ s; b- I5 @
axis1->Point()->Se
TC
oordinates(originPoint);
8 M$ U8 q5 u, k( }; A3 n
axis1->SetDirection(direction1);</P>
. |3 h7 [* z/ Y+ y+ c- v k
<P>//Commit
" c4 K M' p% c
cylinderBuilder1->Commit();
1 b. Y: G+ V" N
cylinderBuilder1->Destroy();
9 B# {& J: E+ E% N% u7 Y
cylinderBuilder1 = NULL;
; g7 W7 m0 c' Z9 x1 Q" n
}
) \& ` B0 R1 g) |" r" [4 y0 X0 ]
</P>
复制代码
' u y. ]% E0 \# O
圆柱体
,
开发
相关帖子
•
NX二次开发block styler如何控制保留值得方法
•
Catia二次开发源码分享: 关于创建命令和菜单方法
•
Catia二次开发源码分享:选择一个平面
•
Catia二次开发源码分享:选择对象的方式
•
Catia二次开发源码分享:鼠标点击创建点
•
Catia二次开发源码分享: 通过鼠标点击创建直线
•
CATIA CAA二次开发各版本软件分享:CATIA_CAA_RADER18-CATIA_CAA_RADER23
•
收集NX电极设计二次开发需求---软件后期对需求提出者免费
•
NX二次开发源码分享: 打印license bundles 信息
•
Catia CAA二次开发源码分享: 选择控件返回选择内容
上海点团信息科技有限公司,承接UG NX,CATIA,CREO,Solidworks 等CAx软件,Teamcenter,3D Experience等PLM软件,工业4.0数字化软件的实施\二次开发\培训相关业务,详情QQ 939801026 Tel 18301858168 网址 doTeam.tech
回复
使用道具
举报
返回列表
发新帖
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
注册
本版积分规则
发表回复
回帖并转播
回帖后跳转到最后一页
在本版发帖
关注公众号
QQ客服
返回顶部
快速回复
返回顶部
返回列表