|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我用SelectWithSingleDialog选中一个component得到component_tag,想要得到所选component中body的数量,代码如下:9 m% U0 I {8 w& x9 W
: n2 w& N) r4 ?
Dim component_tag As NXOpen.Tag" P- Y2 Q% R6 m5 m. {
Dim component1 As Assemblies.Component
0 t# `3 X2 t$ M& k% n8 d: ] Dim all_bodies() As Body
( P: \! l. I6 F2 J! d Dim body_count As Integer: h, \& q7 U5 q7 }7 p
SelectWithSingleDialog(.......component_tag...........)(此处省略)5 V9 z9 W& c/ H7 Y) ~. U6 T; {) B4 s
component1 = ctype(NXObjectManager.Get(component_tag), Assemblies.Component)+ u! A( I. H; ~9 p/ Z
all_bodies=component1.Bodies.ToArray()
, G0 s* f. ~: K4 h; p7 A" E body_count=all_bodies.length" U* [% g O1 g, s6 t) {1 C' ~3 j
MsgBox("Count of Bodies in select Part: " & body_count)
4 h' x6 v& w# T# l5 O
( }- M& G+ [: x/ N- d7 a7 M# H但是提示错误信息,( A0 o% R: {3 `+ F& J
'part' is not a member of 'NXopen.Assemblies.Component'. }& X$ Y0 a( U8 t2 }
: |8 s& C( x8 D我没办法查看帮助文档(公司电脑没有管理员权限不让装),请各位路过的高手帮小弟看看怎么改,多谢了~~~~~~~~~~~~~~~~~~ |
|