|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
tag_t partTag = NULL_TAG;+ a0 c$ N* ?! S, I8 ?' `
double origin[3] = {0,0,0};
+ c v- m: c2 n: P+ J7 Wchar *height = "50";
9 l0 C' {* g( M( u( }' tchar *diam = "10";
- D, v9 O/ D& C0 kdouble direction[3] = {0,0,1};
2 R# s% Q$ z6 d7 `/ E( M- y+ gtag_t cylTag = NULL_TAG;
1 v9 S O) T3 T, w) d$ Duf_list_p_t eageList = NULL_TAG;
0 z) E/ @3 K3 N9 Z. y, |int count = 0;+ M5 e3 R0 |: [" w. X/ f3 n' Z3 R. t
char msg[256];; E/ i7 h1 H) f2 F9 E/ r" x; Z
int i;
0 M: P8 y% y S* R9 Ntag_t eageTag = NULL_TAG;
$ i5 R9 m. ^. Z. Bdouble centroid[2][3];6 v6 g% b! v7 a1 U) J. x f# p% a$ s
UF_CURVE_line_t line_coords;
) Y+ I) }( s; E& A* f9 S8 }7 Wtag_t lineTag = NULL_TAG;
/ G& k5 D& {1 F; C r) I/ @ X" T
9 B" K# W1 b- z; O. R8 sextern DllExport void ufusr( char *parm, int *returnCode, int rlen )9 c; p4 M9 u- m, Z; m1 ^1 B$ S. [
{( Q' V* d9 @$ w3 g# g
/* Initialize the API environment */
! M% {: Z! p$ I4 Y" }- d5 F if( UF_CALL(UF_initialize()) ) I$ a: @& I# l+ W6 U9 | J8 Q
{( `/ z' ?: O: n! `. S6 m
/* Failed to initialize */, m( S1 x" \3 G
return;
* W6 P, [0 ?6 l9 e2 C }$ C1 P- g/ \+ Q5 U0 T7 H9 r
, G( U6 {. W2 _. N3 m
/* TODO: Add your application code here */" P5 \; _3 I4 x; l
0 W* J" R% D1 s3 g5 z UF_PART_new("D:\\part.prt", 1, &partTag);. x' W; g( f. H, h6 T) v( W
' e4 }& z( R9 Y
UF_MODL_create_cyl1(UF_NULLSIGN, origin, height, diam, direction, &cylTag);
' y) A! h) G9 H- C2 Z$ Y UF_MODL_ask_feat_edges(cylTag, &eageList);
' c- X g5 y7 b# g UF_MODL_ask_list_count(eageList, &count);
. q6 T% S4 j6 V+ l0 n# ~ k sprintf(msg,"count number: %d",count);
6 \! i$ e) y: |) f, } uc1601(msg,1);0 v& B! q% v6 y. ]( X/ |5 k
; b6 O: c! P. H( q( N5 L. `
for ( i = 0; i < count; i++)& T% b s) @) X+ t& X. K7 w. x4 Y
{; {5 }* u$ b+ S' C
UF_MODL_ask_list_item(eageList, i, &eageTag);//将对应边保存
8 P7 k F9 n3 u% r
. i& l6 t( g+ X. @, g UF_CURVE_ask_centroid(eageTag, centroid[i]);//将对应的边的中点获取3 \8 C8 o/ i' ]/ j s/ o: _" c
}5 {2 F- O! T' t. {1 K
- U0 j u5 c! W/ q( b6 d line_coords.start_point[0] = centroid[0][0];//第一个曲线的中心坐标# z% J! G- y: Y8 P
line_coords.start_point[1] = centroid[0][1];
* E# M7 J/ y4 D line_coords.start_point[2] = centroid[0][2];9 x) }+ Y0 D, ~, q/ V( ^% `8 |
0 L- r" _. ]# P: _
line_coords.end_point[0] = centroid[1][0]; P6 D6 t$ i# V
line_coords.end_point[1] = centroid[1][1];
! Z2 M5 y; @4 o line_coords.end_point[2] = centroid[1][2];
8 u( e8 ?$ p; _( E5 c% u( n) M+ P
( E/ [/ z5 N4 [2 |* G8 s UF_CURVE_create_line(&line_coords, &lineTag);
6 }+ ~; D$ {" Q0 D* a- K UF_PART_save();
6 S) ~& l0 `9 l* F/ a% i* ~
. j! T2 u9 O) U1 h |
-
-
评分
-
查看全部评分
|