|
UF_UI_set_cursor_view函数在NX10.0里无法选到图纸上视图对像
1 T7 b5 a0 e* N6 F8 j
) X& G0 ]! j6 S }1 ^: i& ~********************************************************************
- Q9 ^& }; G4 w//设置选择的实体类型
0 p* R5 l: ]+ N& b" ustatic int init_proc( UF_UI_selection_p_t select, void *user_data )$ }: {3 g! @ i/ |5 a w8 h
{
' Y( s1 `9 |. u* o* f% wint errorCode = 0;$ {( f% M3 D! T
//选择实体边缘(直线)
. {" v& k' G& Tint num_triples = 1; //选择数量
& X( @, b! p% t6 U% x: Y/ t8 sUF_UI_mask_t mask_triples[] = {UF_solid_type,UF_solid_edge_subtype,1};
+ m8 }2 A5 T2 l9 F* _# IerrorCode = UF_UI_set_sel_mask(select,
4 o; [, a9 {, a1 j- @6 r$ X UF_UI_SEL_MASK_CLEAR_AND_ENABLE_SPECIFIC,//. H. y; f2 R! Y5 `
num_triples, mask_triples);3 j6 H7 X6 C% b! C5 s2 m
if( errorCode == 0)
0 {$ r4 k3 t* B: q7 `6 K4 b{6 x7 p7 N7 C( r( W& W+ u# Y, h
return UF_UI_SEL_SUCCESS;
2 X& O, I. g% {: v8 k0 l}
' w6 `: h8 E/ F: S* {0 ~, } else
+ X+ O( K2 j4 W8 R4 U{
) T/ }4 L+ p* T( X) D- o% g/ _ return UF_UI_SEL_FAILURE;7 U5 O# w" [; T2 s- Q7 W6 {
}/ c* L# |( k a$ W
}
1 k5 b( o& c9 W; P; S2 p3 E- u7 i( y2 @: B! x+ q
/* TODO: Add your application code here */
4 A/ L( _1 k8 Z" {/ A char *message="请选择视图里的对象";
( x( }) t) h0 ]+ @0 q, P char *title="111";
% b1 g$ m6 g& y ]) I( Q4 u) k int scope=UF_UI_SEL_SCOPE_WORK_PART;//选取范围
$ `/ C# C2 m, c" G: e int response;
0 J* p* S& Z6 v& b: j O" p$ r tag_t object_tag;1 ~; k& S+ m- W" U
double cursor[3]={0.0};
0 O2 r/ Y# o% T* d, R" R tag_t view=NULL_TAG;
6 T6 N/ B6 O, H 7 n! s9 g1 T- I8 t
UF_UI_set_cursor_view(0);//0 = Any view,1 = Work view (0可以选择“图纸上视图”里的对象)7 O7 H- r; L+ {$ A2 N$ `1 L
UF_UI_select_with_single_dialog(message,title,scope,init_proc,NULL,&response,&object_tag,cursor,&view); //选择框】+ j8 \: ]6 z& @& e
UF_UI_set_cursor_view(1);//0 = Any view,1 = Work view (0可以选择“图纸上视图”里的对象)6 J- `8 |$ L" o: `
7 D( t4 R! g1 S, Z y7 Y3 |% r
UF_DISP_set_highlight(object_tag,0); //1高亮显示 0不高亮显示* X" J& |- g3 n) y" B
/* Terminate the API environment */; [7 {# Y0 |4 l# m$ w
9 |6 x) }1 S' a4 ^
|
|