|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我用SelectWithSingleDialog选中一个component得到component_tag,想要得到所选component中body的数量,代码如下:3 H# M- \& S* g, D! C
) g' p3 k1 m# O% M2 D ~# a+ ~
Dim component_tag As NXOpen.Tag( p' a5 q; ~. c" f: [* q7 m0 j
Dim component1 As Assemblies.Component9 D* j0 w* ?1 y+ W
Dim all_bodies() As Body
6 l: r2 U+ p4 P+ p- ? Dim body_count As Integer: e4 F' a8 t q5 {$ ^& F' e
SelectWithSingleDialog(.......component_tag...........)(此处省略)
0 j9 N# T2 q g: |3 r4 }' ^! O% } component1 = ctype(NXObjectManager.Get(component_tag), Assemblies.Component)8 x% m" h' F+ X" x4 ]8 }) ~' {
all_bodies=component1.Bodies.ToArray()
* r% W, } w' u0 m4 A8 T: ~* f body_count=all_bodies.length
# U. {( v/ l. m MsgBox("Count of Bodies in select Part: " & body_count)
1 A6 B$ l/ o" k9 K4 }" L$ m: d6 q
但是提示错误信息,
$ |/ d2 v! z2 D8 E3 ~'part' is not a member of 'NXopen.Assemblies.Component'.
/ D1 S. B# l9 r3 p& l6 q" i+ L
/ U( P# D5 r1 i# Q; i' I我没办法查看帮助文档(公司电脑没有管理员权限不让装),请各位路过的高手帮小弟看看怎么改,多谢了~~~~~~~~~~~~~~~~~~ |
|