|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
. N: ~% M5 K/ i0 ]- b/ B
3 G! M8 n6 E+ c0 F
NX二次开发源码分享:选择管道routing线段的方法9 m+ t: z6 t) L5 O% \. d' i+ ?! h
" O5 v2 i4 u r& O代码是C#的,主要是告诉大家masktriple的设置如下:
$ _1 C1 h" M) f' ?
5 \0 {7 b3 U. L: _% k& ?% y
; |1 @# p. K d0 X+ l8 e: ~mask[0].Type = 0;
# l: P/ \. m( `" Q! ~! Q( smask[0].Subtype = 0; 7 P2 g3 I1 m* I/ N
mask[0].SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_ROUTING_CURVE_ONLY; 5 e# X! [% t$ a& M
9 ~0 f3 w, |- ]' c) W: ^
[mw_shl_code=c,true] public static Selection.Response select_route_segment(string prompt, ref TaggedObject obj) . k! b/ H! W! g: @5 C
{ ! |! \! \' z2 U$ a
TaggedObject selobj;
( x- `# R5 w& `# H6 z/ E; V( ] UI ui = UI.GetUI();
" {/ t! t, z+ @2 }) M* Y Selection.MaskTriple[] mask = new Selection.MaskTriple[1]; ! T* |8 E# k/ L; T5 [
{
: e* X/ [# [0 g; `- { mask[0].Type = 0;
6 M- N9 N0 n8 P) ] mask[0].Subtype = 0; 5 e8 _ Z+ J% e+ O& U" n* ?
mask[0].SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_ROUTING_CURVE_ONLY; ; `7 E3 R b6 `0 g/ R% C6 K6 e( O. N
} 3 |' a6 ?, M0 \. P" J( Z
Point3d cursor = default(Point3d);
& K3 \1 v9 G$ t. Y 0 n# s q5 v+ q
Selection.Response resp = ui.SelectionManager.SelectTaggedObject(prompt, prompt, Selection.SelectionScope.AnyInAssembly, Selection.SelectionAction.ClearAndEnableSpecific, false, false, mask, out selobj, out cursor); : R3 \8 U2 \! f6 T3 Y
: W! A9 ~% D; E2 X; s; M. `: l if (resp == Selection.Response.ObjectSelected | resp == Selection.Response.ObjectSelectedByName) ) \6 e' a- W# s4 U
{ / B9 N/ G' @0 y; P
obj = selobj;
# @! e9 Z) o8 N, M; Y% l return Selection.Response.Ok;
9 O" @( B d# y }
4 ]1 }6 @, f+ O, C else % S, Y# z" ], @
{
) p+ G8 Z; L& G5 @; k" ^9 G) l return Selection.Response.Cancel; ' X" M- F) G- N6 H0 R
} ' M! d* ^( D7 b# _& u9 O# e
} [/mw_shl_code], V L/ B B/ T
|
|