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++创建圆柱体特征 ...
返回列表
发新帖
查看:
4263
|
回复:
0
[二次开发源码]
NX二次开发源码分享:NXOpen C++创建圆柱体特征
[复制链接]
admin
admin
当前离线
积分
82265
2477
主题
1280
回帖
8万
积分
管理员
PLM之家站长
积分
82265
发消息
发表于 2013-11-4 12:06:33
|
显示全部楼层
|
阅读模式
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要
登录
才可以下载或查看,没有账号?
注册
×
NX二次开发
源码分享:
NX
Open C++创建圆柱体特征
7 E2 D5 M2 ^' ?0 {3 B
% k q! J( ?7 r3 T4 f
<P> </P>
复制代码
3 L& r! ]$ c' S! _
<P>void CreateCylinder_UsingUDB::CreateCylinder()
: A3 V( k% N; B' r! k+ U7 f
{
& d! D- m4 b; r; P* J' w8 N5 i2 s
Part* workPart(theSession->Parts()->Work());</P>
0 [: t" s! n/ K% L! N9 Q
<P>Features::CylinderBuilder* cylinderBuilder1 = NULL;
9 F! |8 F6 a) W8 n. b. v7 v4 D7 \
cylinderBuilder1 = workPart->Features()->CreateCylinderBuilder(NULL);</P>
& B U/ y& p6 @0 v4 h, |- q; J* E% q
<P>//Get the point
: M* M7 X+ r8 @8 F! [
PropertyList* pointPropertyList = point0->GetProperties();
- O+ h i) H1 H5 ~" s" a
Point3d originPoint = pointPropertyList->GetPoint("Point");
* u8 u) F4 c7 h& D. b/ b% g
delete pointPropertyList;
) ?' V4 Z3 X( c% J9 u! m
pointPropertyList = NULL;</P>
' }1 x' [5 @. m4 a
<P>//Get the direction
) R3 h0 p2 F% \. u8 }( o2 p' l
PropertyList* vectorPropertyList = vector0->GetProperties();
; M$ v1 E% i$ o% J m0 e: t& w
Vector3d direction = vectorPropertyList->GetVector("Vector");
! S! ?) w) d6 w' |& A
delete vectorPropertyList;
$ m9 k- b7 e0 Y2 T- X4 w
vectorPropertyList = NULL;</P>
# A. E" F0 }" n+ j1 B9 j: s5 ^" @$ Y1 M
<P>Direction* direction1 = NULL;
( c" D& p4 t1 R3 S, H
direction1 = workPart->Directions()->CreateDirection(originPoint, direction, SmartObject::UpdateOptionWithinModeling);</P>
8 K Q' M Q$ w) X9 n) G
<P>//Set diameter and height
7 h$ }: n3 \1 ~4 R% u9 U
std::stringstream diameterValue;
( y- N" K( b, b5 R. W; z/ [
diameterValue << diameter->GetValue();
, m% D4 v' a1 Q! V+ x
std::stringstream heightValue;
9 J4 _" C" h8 V; K! x; {- E, `& g3 H( `
heightValue << height->GetValue();</P>
4 X( e \4 i/ I; |( h
<P>cylinderBuilder1->Diameter()->SetRightHandSide(diameterValue.str());
( F) ?( a8 F" R* s& b
cylinderBuilder1->Height()->SetRightHandSide(heightValue.str());</P>
. a8 c+ K; q! a) K6 p" {3 u
<P>//Set the axis
# z- Z) d2 T0 e9 Q
Axis* axis1 = NULL;
# N2 K( |$ ^# x
axis1 = cylinderBuilder1->Axis();
! B, m! [& t6 z8 d8 @0 w% v
axis1->Point()->Se
TC
oordinates(originPoint);
5 P: m% t6 x3 t. w
axis1->SetDirection(direction1);</P>
7 U- G5 v6 p# Y) j. c$ m" X
<P>//Commit
; D, Z s. p7 }8 c
cylinderBuilder1->Commit();
* W% h0 C8 [- g0 c. s
cylinderBuilder1->Destroy();
. Q0 u( [, |' F
cylinderBuilder1 = NULL;
. V* o" V% L6 y
}
: x/ I+ Q& q* A s3 P \( o, f
</P>
复制代码
, l3 t( s/ \4 R( i. M3 K
圆柱体
,
开发
相关帖子
•
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
您需要登录后才可以回帖
登录
|
注册
本版积分规则
发表回复
回帖并转播
回帖后跳转到最后一页
浏览过的版块
NX7.5二次开发入门视频
NX9.0 二次开发入门实例视频
在本版发帖
关注公众号
QQ客服
返回顶部
快速回复
返回顶部
返回列表