|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我用SelectWithSingleDialog选中一个component得到component_tag,想要得到所选component中body的数量,代码如下:5 q& T- {& E! v( c/ Z9 O
- P% w# o. E; d r7 {- R' b$ G S Dim component_tag As NXOpen.Tag. x) Y$ J, w8 A! U% e
Dim component1 As Assemblies.Component. N% f$ v' \$ u1 j, I* R& I" U+ |
Dim all_bodies() As Body
* E- v" \! |2 H( U) S8 K" A. } Dim body_count As Integer
0 \- T- {0 z6 T( v( E SelectWithSingleDialog(.......component_tag...........)(此处省略)
( l7 y9 j. k- F; i; z1 z, ? component1 = ctype(NXObjectManager.Get(component_tag), Assemblies.Component)% u5 p. P+ J+ F/ \% K5 U, v
all_bodies=component1.Bodies.ToArray()
( O' R: D2 O' `8 z4 U) V9 U, U body_count=all_bodies.length
3 ^! }3 O9 Y( u, }/ M MsgBox("Count of Bodies in select Part: " & body_count)0 ]5 h+ X; A0 G( K, c( S
2 j! q6 a+ z2 t0 T' q
但是提示错误信息,
$ h/ c1 J* ~" G9 F8 R8 A'part' is not a member of 'NXopen.Assemblies.Component'.. y1 o/ B" Q, H1 s/ a; z
9 G- e) t/ B- M" }4 D( f7 h2 i我没办法查看帮助文档(公司电脑没有管理员权限不让装),请各位路过的高手帮小弟看看怎么改,多谢了~~~~~~~~~~~~~~~~~~ |
|