|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
创建实体特征/ p* |; ~* c) c
0 k) a1 D4 Z" l3 h* z: ]. C实体特征主要包括凸台、槽、旋转体、孔、盒体、倒圆、倒角和厚曲面等特征,创建实体特征采用CATIPrtFactory 工厂中的方法,
! V6 ]& C8 R; u8 P5 e# V7 K& ^
/ s9 p( P% h5 \6 d创建实体特征的方法
9 p, T+ E! n4 U. O9 T9 F+ U( k/ h凸台 CreatePad
3 t( h# B! C& h. j1 U( Y槽 CreatePocket8 |& [/ h8 p4 V2 v
旋转体 CreateRotate: H8 \; P$ X4 |. C* T. O" `1 b
孔 CreateHole
5 H4 i, e2 l) _8 o9 w! M" q, r9 w盒体 CreateShell0 h% P6 i3 M# M' z
倒圆 CreateFillet$ `2 K3 @0 E0 J- S6 k: L
倒角 CreateChamfer& D6 Z6 J# g) A6 l; i0 t
厚曲面 CreateThickness4 F2 o* b) |- y _- i3 M
$ \4 x/ q$ X$ ]# r
$ L: X; S0 |/ k2 Z# m$ V6 h% G现举创建孔的例子如下:
4 K; f3 I }% a$ d. w1.常用的创建孔的方法包括三种,依次如下。8 X8 ]0 z* ~1 p. s8 @: \
public virtual CATISpecObject_var CreateHole( const CATISpecObject_var ihSurface,
4 P7 ~3 x) m5 S! W5 |+ [7 Mconst CATISpecObject_var ihDirection) = 0
5 s( t& p1 }( ?3 {8 o参数介绍:ihSurface 指支持孔的平面或曲面;ihDirection 指孔的特征方向,特征方向可用
; S; o7 n) B* x9 N2 Q, yCATIGSMFactory 中的CreateDirection 创建,孔方向若为NULL_var,则按照曲面的法向创建孔。
. Y6 ^ j; N) Y# X, Dpublic virtual CATISpecObject_var CreateHole( const CATISpecObject_var ihPoint,
1 A; B( P: z& O# n7 t7 C7 X" Aconst CATISpecObject_var ihSurface,
7 }* H: K K: P, Uconst CATISpecObject_var ihDirection,( t7 l) o5 P5 G6 }7 |+ ~2 b
const int IsPointOnSurface) = 0' r6 h4 O/ c o$ M9 d: b
参数介绍:ihPoint 指在支持面上的特征点;ihSurface 指支持孔的平面或曲面;ihDirection0 \# U) e3 [8 @0 }- l" b
指孔的特征方向,孔方向若为NULL_var,则按照曲面的法向创建孔;IsPointOnSurface 的值如" C/ ?6 d- w8 p
果为0,说明ihPoint 不在ihSurface 上,若为0,则说明ihPoint 在ihSurface 上。
' q; V! D' q9 wpublic virtual CATISpecObject_var CreateHole( const CATMathPoint iMathPoint,* _- h5 b6 ]* d. w9 J
const CATISpecObject_var ihSurface,
: ~ n" S9 T! F$ {( P) Qconst CATISpecObject_var ihDirection,
& y' R8 I7 b/ W9 ~$ gconst int IsPointOnSurface) = 0
! J/ a, [0 C, J K& s' v: ^* _参数介绍:iMathPoin 指在支持面上的数学点;ihSurface 指支持孔的平面或曲面;ihDirection
( @8 j& u: W, L5 ^. i* f5 u指孔的方向,孔方向若为NULL_var,则按照曲面的法向创建孔;IsPointOnSurface 的值如果为
* B' [# n9 ~' j1 \0 I0,说明ihPoint 不在ihSurface 上,若为0,则说明ihPoint 在ihSurface 上。& \3 X1 t. p& O6 |. G6 q" j
2.设置孔的参数; _( t6 `. R" M
CATISpecObject_var spHole = spPrtFactory-> CreateHole();! E( W$ F2 A2 r2 x' V& v( Z# }9 B
CATINewHole_var spNewHole= spHole;
, D$ D& i" v- j/ }6 }1 ispNewHole-> SetHoleType(1);//设置孔类型为简单孔7 c- S) t2 Q U; l+ A3 _
spNewHole->SetBottomType(1) ;//设置孔底面类型为平底
; c, \2 S; O5 T L' kspNewHole->SetDiameter(5)//设置直径0 o! Q# x3 ^& V) ?$ f, n8 Z' O7 k. C
spNewHole->SetLimit(1)//设置为盲孔( m# t( i/ s$ s; w9 w
CATIHoleLimit_var spHoleLimit = spHole;- ]6 D1 c9 R# J0 t% t$ H" s
spHoleLimit ->SetOffset(5);//设置孔的深度
) H+ [7 q" a5 `& a z# L3.将孔添加在结构树中
. n1 l: l: J7 {5 _- A% c
: z; I8 m, r' j" z* f4 PspHole ->Update();
) [6 h. y/ ?9 g) }, |, o& fCATIGSMProceduralView_var ispProcView = spHole;+ L7 X# u) c- E1 R# y5 j' _
if (NULL_var != ispProcView ) {HResult rc = ispProcView ->InsertInProceduralView();}0 G- N: f9 T: q* Z- o3 H
, `" Z) i2 S3 T |
|