|
如题。在工程图里用鼠标在任意位置单击后即可生成一个点,这该如何实现,小弟试过用函数UF_UI_ask_sel_cursor_pos(),编译没问题,但调试后没反应,哪位用过此函数的高手指点下,小弟万分感谢。9 V. e( I7 |0 E
这是部分代码:0 I; [8 P$ h7 Z
extern "C" DllExport void ufusr( char *parm, int *returnCode, int rlen )7 x! N3 m/ x8 M' m( {
{3 ]$ y3 c, `/ X
/* Initialize the API environment */' o1 H0 L0 u" w# Y) x( p# l( ~! Q. x
int errorCode = UF_initialize();& U6 l- B5 F- b( K' |! O
if ( 0 == errorCode )
$ k# n3 ?8 j5 y: c+ ~5 s {7 y$ ?. g5 ~# p+ I
/* TODO: Add your application code here *// D% z+ O6 Y# H3 }) u0 d
int status=0;2 } \2 D! d4 N
double cur[3];$ \& c" y( \, w0 _! N8 n
UF_UI_selection_p_t select;
2 s/ D$ R7 l& J tag_t view;
2 x% M# V2 t% T! m! O tag_t cur_tag, text_aid_tag;, ?8 }( S5 c8 g+ k
UF_DRF_object_t object;* H' y8 ]/ q% A
status = UF_initialize();
: F. q. o$ Y- o. i& A% E v; z if (!status)) |/ s+ T; t0 V }. S
{& E, |1 w, q. g" H5 l
status=UF_UI_ask_sel_cursor_pos(select, &view, cur);
1 U# N# D- B* w7 J$ n/ R/ Z% E3 ` }
4 @7 L/ ?, w2 _+ c" W# p4 {+ B" y1 L if (!status) s/ f$ e6 d$ K& h6 b# N ^' h; ~
{8 H$ X: X, K" i* @$ ?6 f d' L9 {; s
/* initialize the object structures *// R2 j: c9 A) @5 E0 X8 {9 \, z
UF_DRF_init_object_structure(&object);
7 D2 J& }9 x8 J) ~- ?" ~: p /* create a base point */
. C0 d5 _9 F4 m1 ^ status = UF_CURVE_create_point(cur, &cur_tag);
, j0 e9 I5 U8 {3 a } |
|