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++创建圆柱体特征 ...
返回列表
发新帖
查看:
4241
|
回复:
0
[二次开发源码]
NX二次开发源码分享:NXOpen C++创建圆柱体特征
[复制链接]
admin
admin
当前离线
积分
82265
2477
主题
1280
回帖
8万
积分
管理员
PLM之家站长
积分
82265
发消息
发表于 2013-11-4 12:06:33
|
显示全部楼层
|
阅读模式
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要
登录
才可以下载或查看,没有账号?
注册
×
NX二次开发
源码分享:
NX
Open C++创建圆柱体特征
4 v) ^ g9 B: O
" h# L& X1 z" I( }
<P> </P>
复制代码
4 ]' I5 b8 U3 q) j C( R* o$ P8 o
<P>void CreateCylinder_UsingUDB::CreateCylinder()
& o. T0 n: {% |: M8 ]- Q) j
{
; x. e" K0 j: Z6 r4 t$ q) d9 V
Part* workPart(theSession->Parts()->Work());</P>
& I4 c. A6 S2 c& U
<P>Features::CylinderBuilder* cylinderBuilder1 = NULL;
) d% i: Q$ i2 D$ P- [7 p/ @/ [
cylinderBuilder1 = workPart->Features()->CreateCylinderBuilder(NULL);</P>
$ j0 H3 q4 F2 Y" R! ]! y
<P>//Get the point
0 t3 w" @6 I6 e7 M* p
PropertyList* pointPropertyList = point0->GetProperties();
4 a. l, z# W8 G# a1 p' W# q4 z
Point3d originPoint = pointPropertyList->GetPoint("Point");
% x# W, R2 J! @& ~3 z
delete pointPropertyList;
5 n4 f. F& c; b( X N( d0 y' i
pointPropertyList = NULL;</P>
: }$ ]1 O7 a( `3 `
<P>//Get the direction
) G- m, t* z4 |7 W
PropertyList* vectorPropertyList = vector0->GetProperties();
1 M+ I+ Q( R! ~
Vector3d direction = vectorPropertyList->GetVector("Vector");
/ ^8 X2 J/ M3 @7 [5 s4 R9 Z1 E
delete vectorPropertyList;
3 s0 w0 b# i6 R% d) h
vectorPropertyList = NULL;</P>
3 W$ C1 |7 D* A+ F; b
<P>Direction* direction1 = NULL;
& l D/ g# x9 m, R
direction1 = workPart->Directions()->CreateDirection(originPoint, direction, SmartObject::UpdateOptionWithinModeling);</P>
# d2 Q1 S4 A( T8 E! ]" z5 o# @
<P>//Set diameter and height
) {0 V$ Q0 K' A7 k5 ~5 G _ T. r
std::stringstream diameterValue;
+ J' P3 A* Y( E' d2 P5 U
diameterValue << diameter->GetValue();
+ }' P) |& N# I' H' P
std::stringstream heightValue;
, g. E9 U# [3 z- h8 ]
heightValue << height->GetValue();</P>
$ h. k9 P# p$ _ {+ ~
<P>cylinderBuilder1->Diameter()->SetRightHandSide(diameterValue.str());
7 |$ G9 ^: k; t# x
cylinderBuilder1->Height()->SetRightHandSide(heightValue.str());</P>
$ m6 X0 e \0 g# J$ `8 O
<P>//Set the axis
+ K& s0 V* N1 J! @; j
Axis* axis1 = NULL;
2 D$ ]) Y; H7 R
axis1 = cylinderBuilder1->Axis();
7 f0 l+ F/ ]0 m( U# u9 n/ ?
axis1->Point()->Se
TC
oordinates(originPoint);
8 S' C, |' \ e
axis1->SetDirection(direction1);</P>
3 Q! ~9 f. _# {% i, w e0 ]
<P>//Commit
; T" M0 y6 s# J* t- \
cylinderBuilder1->Commit();
) B% O" u6 N+ p6 x9 l
cylinderBuilder1->Destroy();
: @- {; U& ~1 n' t, f9 E0 `
cylinderBuilder1 = NULL;
3 q5 g) j5 i$ u! K6 l, ?" t
}
8 |! T% L0 _! u3 K4 N$ _ P# U' V
</P>
复制代码
' k- n' T5 ~, {4 A: Q9 d9 |( h
圆柱体
,
开发
相关帖子
•
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客服
返回顶部
快速回复
返回顶部
返回列表