|
如题。在工程图里用鼠标在任意位置单击后即可生成一个点,这该如何实现,小弟试过用函数UF_UI_ask_sel_cursor_pos(),编译没问题,但调试后没反应,哪位用过此函数的高手指点下,小弟万分感谢。
5 m8 w* x0 K6 C5 x1 V% l6 W这是部分代码:
* `. C: l3 b5 Y( N. S/ [7 o5 Rextern "C" DllExport void ufusr( char *parm, int *returnCode, int rlen )
- a2 W$ a/ p& f+ K; i7 r4 ~+ v{$ J. @ C" Q M5 K* o, B
/* Initialize the API environment */$ z4 G1 K9 b0 j. S, x/ t! A
int errorCode = UF_initialize();
% k! V3 A# m2 ^5 Q, }, { if ( 0 == errorCode )
9 E3 R L$ `( {3 O {) T0 R3 r6 f8 Q G
/* TODO: Add your application code here */
1 g1 ~/ Y4 V* O int status=0;
' E5 K* W; o4 K3 t double cur[3];. D" V/ L8 M9 p
UF_UI_selection_p_t select;
, y5 k9 N# {8 `* R F# i, m# t/ d tag_t view;
4 |/ O0 E, W3 G1 @1 i tag_t cur_tag, text_aid_tag;
. P9 g2 N/ E6 K( T7 B UF_DRF_object_t object;( ]; y. r& \& }7 l! _! X
status = UF_initialize();
: i! S ^4 ^* l6 B1 ?& `+ n4 p if (!status)
/ h" I* G2 M- `- j4 y9 g: F {! s+ n* w* t+ v5 L) I- m
status=UF_UI_ask_sel_cursor_pos(select, &view, cur);
* y' w3 a2 }& t1 o( H. { }
/ K6 s. {! l$ u if (!status)2 p& `, k: X1 x+ [
{+ I1 m, b: K. G2 [ m
/* initialize the object structures */
& d& S% M% X$ A- K% \( D/ m UF_DRF_init_object_structure(&object);
% { b$ q W& p6 }* [! A /* create a base point */ c( i9 h7 h5 g7 D! t3 [
status = UF_CURVE_create_point(cur, &cur_tag);
0 _) K! `. I3 \/ z; k. v8 e } |
|