|
UF_UI_set_cursor_view函数在NX10.0里无法选到图纸上视图对像
# y U O" u2 |6 c4 h0 a
2 o2 `! o- i4 O- d+ C& \, s********************************************************************7 I; r4 Z& p, e8 v; b
//设置选择的实体类型
0 b8 k& S9 j* o. x! h; A5 x" z9 Xstatic int init_proc( UF_UI_selection_p_t select, void *user_data )# v" J4 y1 D' y
{
. n! S0 C& o5 |& b1 b* j% ~int errorCode = 0;% k2 C3 l- J) B5 v- [2 a3 } a
//选择实体边缘(直线)
; k4 O5 X7 Z2 K( Hint num_triples = 1; //选择数量
6 \/ t9 F0 l$ v5 s% sUF_UI_mask_t mask_triples[] = {UF_solid_type,UF_solid_edge_subtype,1};" u$ L; [; J. x$ f7 J; E' q1 r
errorCode = UF_UI_set_sel_mask(select, 5 U y& T" _: I y, u$ ` }
UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC,//+ W% e& q) d) ]& k4 Z5 t& \4 u
num_triples, mask_triples);
+ b! X% G0 I: t' _9 b" ^! Y" v+ Pif( errorCode == 0)
2 N# r1 g2 } u: [{
i9 u4 m; o/ I jreturn UF_UI_SEL_SUCCESS;1 }+ a: ~/ Z. m6 d* O: y) N& |( V6 Z
}
5 B; U: y" t( y2 z+ w" A& T else
/ r7 y& k2 `5 G{
& w$ B+ ?8 B3 x8 o' @ return UF_UI_SEL_FAILURE;" Z1 R9 _% s+ s( S
}
1 C4 s* C7 k# \+ n" O}0 }6 t' L; n; A. [5 B2 e
+ ^2 }0 s) ?7 m. {* p4 n j
/* TODO: Add your application code here */
9 V& ~& A9 O5 ^ char *message="请选择视图里的对象";
4 W! A, B0 y4 C5 ~2 T8 R$ Q char *title="111";3 U6 G4 C2 X! G l
int scope=UF_UI_SEL_SCOPE_WORK_PART;//选取范围
6 G4 E8 s7 P4 E+ ?( K3 w j int response;
$ x& p% W" C- P/ U5 l tag_t object_tag;% A- F5 z7 a* W6 y0 F3 f
double cursor[3]={0.0};
/ f8 @+ J6 k" ?0 J tag_t view=NULL_TAG;$ E+ F: l2 U( n5 i
( A( ?; D4 G& ^ UF_UI_set_cursor_view(0);//0 = Any view,1 = Work view (0可以选择“图纸上视图”里的对象)' \! V3 U( n1 K* j. X
UF_UI_select_with_single_dialog(message,title,scope,init_proc,NULL,&response,&object_tag,cursor,&view); //选择框】 c. |4 \) x7 @( Y2 D" j4 s" D
UF_UI_set_cursor_view(1);//0 = Any view,1 = Work view (0可以选择“图纸上视图”里的对象)
! q3 w0 D0 z9 d; a
0 A7 z; g( q6 c# B* J' p% wUF_DISP_set_highlight(object_tag,0); //1高亮显示 0不高亮显示
. K. ~6 Z2 |. `' t7 ?/* Terminate the API environment */
+ n* g; m, P& _4 m$ g9 i
: E. E+ Y9 c& ^* J6 V2 \ |
|