|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我用SelectWithSingleDialog选中一个component得到component_tag,想要得到所选component中body的数量,代码如下:
5 k* w' x/ `9 Y _
8 a6 N* m) c, `# I7 B0 x Dim component_tag As NXOpen.Tag; {- X9 n4 j& @- L
Dim component1 As Assemblies.Component
. M: o- m( m4 z Dim all_bodies() As Body 6 d' P" F/ |8 M N0 e
Dim body_count As Integer5 n9 |, S* P v- R0 R; `
SelectWithSingleDialog(.......component_tag...........)(此处省略)
) Q+ y, ~ o( @& t* J component1 = ctype(NXObjectManager.Get(component_tag), Assemblies.Component)3 F" d4 z1 c7 p; ]6 R( @
all_bodies=component1.Bodies.ToArray()
/ ~1 I# t" X5 t5 R5 i/ T body_count=all_bodies.length
Y6 Q* ]6 c2 h: ?! C7 d2 a; V MsgBox("Count of Bodies in select Part: " & body_count)" s, u( V) d; a0 G k9 G0 v! n
' y& |2 c' b! d6 y. G. Y2 A/ b但是提示错误信息,
/ ~: h) u$ g2 X& _# ?. S3 M4 R'part' is not a member of 'NXopen.Assemblies.Component'.7 q2 G# A X/ d% K
! S+ f0 }4 j& K" B: Z1 }我没办法查看帮助文档(公司电脑没有管理员权限不让装),请各位路过的高手帮小弟看看怎么改,多谢了~~~~~~~~~~~~~~~~~~ |
|