|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
; \3 ^& }" _' R. s+ y! i- j
2 M6 D" m( k5 n
NX二次开发源码分享:选择管道routing线段的方法, H; I4 Q: A2 z5 S& l
# h- l" ]+ q4 H2 c1 q1 W1 r" \3 z
代码是C#的,主要是告诉大家masktriple的设置如下:% ^8 V% b1 m& q2 B. k0 y
( c& U' c! h/ E8 f! z g
. X3 u, _, q2 q$ k+ E+ Rmask[0].Type = 0;
7 ~2 e5 l0 N: Y( o5 D$ k: Z6 w( bmask[0].Subtype = 0; $ \- L: J% K9 Y+ [0 V2 U) T9 E
mask[0].SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_ROUTING_CURVE_ONLY;
7 w& E- a6 E, [& ?3 f" M# t; d( w% y0 P @8 ^# ^( y$ {
[mw_shl_code=c,true] public static Selection.Response select_route_segment(string prompt, ref TaggedObject obj)
" b4 V; ? j/ ?8 e, l { & d/ B* {% j7 ~5 H8 f, v
TaggedObject selobj;
, W2 N& J, t/ i5 m UI ui = UI.GetUI();
. x$ N7 S7 Y0 [8 k, ~! E* x) ? Selection.MaskTriple[] mask = new Selection.MaskTriple[1];
8 p: H2 R! r1 r. _. e4 C0 N { . L/ _8 R, r( l, e- S+ W: t$ R
mask[0].Type = 0;
: W' b9 x" @6 ?2 X% J mask[0].Subtype = 0; 6 Q) Q" j, z0 E: {' Q' G4 e
mask[0].SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_ROUTING_CURVE_ONLY; $ l) y8 @/ M* ]) D6 N7 A3 }
}
. ~: ^! ~ t8 B P" n2 o Point3d cursor = default(Point3d);
. s+ g3 x! |/ G0 k ; t" s% U& @( o3 R6 _% @
Selection.Response resp = ui.SelectionManager.SelectTaggedObject(prompt, prompt, Selection.SelectionScope.AnyInAssembly, Selection.SelectionAction.ClearAndEnableSpecific, false, false, mask, out selobj, out cursor); P# e0 ?9 v. ~* U: k- o* h
" ]. Q( ]; b% L0 G1 G" Y R if (resp == Selection.Response.ObjectSelected | resp == Selection.Response.ObjectSelectedByName)
' p1 s: I& c: A7 b* U {
. B0 A6 Y: @4 ~7 a! |0 J2 a obj = selobj;3 z9 L$ f& ^! J
return Selection.Response.Ok; " k7 W7 d+ L s4 d2 p5 ]
} S* M' z7 Y5 g- _: I; |: B" w
else
& e2 |7 Y& B: R2 y# M4 W/ o {
0 L+ x' ~( m( \: e2 g, Z3 I return Selection.Response.Cancel; $ n6 z+ O1 N- ]1 z& x
}
# g- e0 t( K. f } [/mw_shl_code]
* l6 j, _# D9 V: S& X& K6 }2 j |
|