|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
tag_t partTag = NULL_TAG; p" f4 R4 R7 p
double origin[3] = {0,0,0};) w/ }8 r& h* ^( x- e7 r
char *height = "50";) l2 [# D9 }. v$ K' z& ?& E
char *diam = "10"; t) g' H6 {: m$ J3 \; t0 l& V6 A
double direction[3] = {0,0,1};: W! G1 v" I" B+ _; e
tag_t cylTag = NULL_TAG;/ ]! H- `- f+ q. M
uf_list_p_t eageList = NULL_TAG;2 `4 A1 J: J/ \! S: T
int count = 0;
. j. p2 ]3 t9 E( Ychar msg[256];2 t' {# q: a f' M
int i;
% m: I9 e8 y# A; Vtag_t eageTag = NULL_TAG;5 c, _0 m- h, Z7 ?
double centroid[2][3];$ J, J) n; e6 G7 T y7 g) D
UF_CURVE_line_t line_coords;
l6 {% ]) \% y% r; Dtag_t lineTag = NULL_TAG;
7 K+ D8 q3 c$ U1 Y! B' [5 i9 \5 a g
8 |) @9 k a: ]& Y! I _# ]extern DllExport void ufusr( char *parm, int *returnCode, int rlen )
/ s' R( Y/ V0 ]( ~6 M( L. n8 K{
0 i' O; s1 S" ]- F/ O1 e' l- b /* Initialize the API environment */
; o' q% c y1 N% u+ C1 x if( UF_CALL(UF_initialize()) ) 6 x0 J- n6 Y0 @
{
; ^' ~5 A7 z$ M8 @+ X0 i /* Failed to initialize */
* t ^+ S- J2 q/ S9 W% }$ D9 O. M, t' \ return;
4 m* T. b. ]6 T }& Q6 `1 L w2 H8 G
8 s1 B4 p1 H5 O
/* TODO: Add your application code here */
0 H* p# c! V4 M0 L7 G! a
$ ?1 q2 J" g0 Y- ~% Z UF_PART_new("D:\\part.prt", 1, &partTag);
2 N' p9 e- @. R! f; k! n' i1 g3 n! G9 m! ~8 n7 T
UF_MODL_create_cyl1(UF_NULLSIGN, origin, height, diam, direction, &cylTag);
6 Q4 `: u M* A UF_MODL_ask_feat_edges(cylTag, &eageList);& |/ v4 }1 j2 l K
UF_MODL_ask_list_count(eageList, &count);5 C" j% O; K f" P H% D: A. w) b e# C
sprintf(msg,"count number: %d",count);9 [! g' k6 q7 z6 G$ Q
uc1601(msg,1);5 }) Q+ D; e5 [# ?9 s. I
- m4 i9 a: G8 ~ H& m* V for ( i = 0; i < count; i++)
0 O; h& @2 {! \/ ^ {$ f: U- {/ b: ^" w+ Q
UF_MODL_ask_list_item(eageList, i, &eageTag);//将对应边保存
- A3 M* |, q& P, r3 g4 i# ~" F" t- Y: x" C4 Z: _ l
UF_CURVE_ask_centroid(eageTag, centroid[i]);//将对应的边的中点获取. I6 [, ~5 W: w
}; \# [8 T8 J8 D' V% C6 A
% t# ?4 P S; o9 R, H- m/ V
line_coords.start_point[0] = centroid[0][0];//第一个曲线的中心坐标5 `* J0 ~8 ^" `" h6 Q' m2 U# o
line_coords.start_point[1] = centroid[0][1];
1 x# A4 |- ]$ N1 G o* f" S line_coords.start_point[2] = centroid[0][2];* S0 H; P/ [5 ^5 X
) l: H+ v0 ^% u: ~& v9 o3 ^ line_coords.end_point[0] = centroid[1][0];
3 U, x& p' Z9 }6 m$ |% ]# O line_coords.end_point[1] = centroid[1][1];
( }; n; Y k) M line_coords.end_point[2] = centroid[1][2];
' M4 X; w p; i+ a( T' N7 Q$ G7 `# u. b& h
UF_CURVE_create_line(&line_coords, &lineTag);: @ ]7 ~# ~8 x& @
UF_PART_save();% i! b$ d( [# `0 v' @$ I
9 h0 {; i( C4 r% ~! F |
-
-
评分
-
查看全部评分
|