|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
tag_t partTag = NULL_TAG;
T1 R( M6 j8 @/ Rdouble origin[3] = {0,0,0};+ M2 w! @% c9 Q9 b7 B5 X! Z
char *height = "50";
( ?+ e7 Y! c* K' B( V! a+ P6 Z* }char *diam = "10";
R% d. Y. Z4 l$ {1 g' idouble direction[3] = {0,0,1};# X3 u& p3 g, e7 j1 }
tag_t cylTag = NULL_TAG;
3 u3 U1 W9 a) ^7 c5 A5 H4 f) Suf_list_p_t eageList = NULL_TAG;, U% `, H0 I/ b9 t2 h( A8 L: `
int count = 0;
0 w# _3 Z* w7 x) Rchar msg[256];6 o) U9 n( M2 O U* I
int i;4 |6 }: J9 n1 `# ~
tag_t eageTag = NULL_TAG;3 K+ `: @1 S x" A0 H; p
double centroid[2][3];
8 w' H0 g0 ^$ ^, C8 QUF_CURVE_line_t line_coords;
2 [8 K* h. W; I( Z8 H/ c Itag_t lineTag = NULL_TAG;
0 }! m! g/ N. G
9 o+ e f8 d8 Bextern DllExport void ufusr( char *parm, int *returnCode, int rlen )
2 z x; M$ P7 R6 W9 F{( h1 H1 F; `6 ]9 @
/* Initialize the API environment */) h9 D. Z/ {( i y
if( UF_CALL(UF_initialize()) )
! h( w7 G* h i$ f9 O) R {
1 K+ l- d9 q# Z /* Failed to initialize */% B9 Z7 b: l/ i* [! P
return;
/ w, t5 B0 ^$ t }
$ J7 S! }) ^- p) Z/ g6 J! r5 Q( d+ h5 |* Q9 R; T
/* TODO: Add your application code here */7 Q. l" J0 ^8 c
1 j- y# |6 J& } UF_PART_new("D:\\part.prt", 1, &partTag);
+ V5 f) K- S% ~9 d9 V5 B) u6 G5 T0 }4 _9 j1 [- F
UF_MODL_create_cyl1(UF_NULLSIGN, origin, height, diam, direction, &cylTag);, D/ W; X0 R! z% A# ^5 V7 K
UF_MODL_ask_feat_edges(cylTag, &eageList);
1 Y9 w+ K. c8 e+ I H" f( [ UF_MODL_ask_list_count(eageList, &count);
( s# |' v. N+ l |3 M0 V sprintf(msg,"count number: %d",count);9 J% x" `% w- _7 {0 d/ ]6 N
uc1601(msg,1);
+ M" z* v& W3 H& i# {* n3 C5 g/ m6 C8 c: m
for ( i = 0; i < count; i++)5 H, x: s2 t8 q3 C7 |% E
{
& O% C6 M X4 B, ~7 D UF_MODL_ask_list_item(eageList, i, &eageTag);//将对应边保存3 @9 i5 N6 t0 ?+ d& T
; g, f% Q7 u2 r- {% B d
UF_CURVE_ask_centroid(eageTag, centroid[i]);//将对应的边的中点获取
" F7 o0 E/ I+ Y }* r0 {# ?) [* q4 Z" g
8 y! N. {3 q! b4 `: ?' c8 f; W
line_coords.start_point[0] = centroid[0][0];//第一个曲线的中心坐标$ x( h" A" o; `& }: j- {7 d
line_coords.start_point[1] = centroid[0][1];
: r5 Y3 I$ F( f, f line_coords.start_point[2] = centroid[0][2];; k6 O, ~3 B6 f) j# X
& U3 ?4 ?; ~8 _
line_coords.end_point[0] = centroid[1][0];
& J. I* C# _: Q( X; {4 R line_coords.end_point[1] = centroid[1][1];
* e! J1 \4 A9 L# D& W4 n line_coords.end_point[2] = centroid[1][2];, x% ]/ V3 ]0 b5 y7 y& t
# O. v. B- ^' a& s% N/ b& j UF_CURVE_create_line(&line_coords, &lineTag);
+ o* ^0 W" j1 f$ j Q2 { UF_PART_save();
" E7 i) N% g( J6 |* r3 g$ d5 n/ t8 \2 r" j" T- M$ S4 J
|
-
-
评分
-
查看全部评分
|