|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我用SelectWithSingleDialog选中一个component得到component_tag,想要得到所选component中body的数量,代码如下:7 y. ]- F0 S( f1 ]* C0 i+ i
/ D* t6 G# v, l: i& b% x: J0 ]
Dim component_tag As NXOpen.Tag- O0 |6 D3 Q w# y) ?* _
Dim component1 As Assemblies.Component
* T$ [0 o& B9 x. U5 s9 { Dim all_bodies() As Body
# Z1 i+ N3 z( N5 h w Dim body_count As Integer
5 `- a9 W4 S; R) C |& n* } SelectWithSingleDialog(.......component_tag...........)(此处省略); X1 f' l6 Q) x) |+ {% v4 _
component1 = ctype(NXObjectManager.Get(component_tag), Assemblies.Component)
9 _$ ]% X, V- Z, R all_bodies=component1.Bodies.ToArray()" x; d% g0 T% \8 P( p3 _
body_count=all_bodies.length/ }, R" m/ [# H' r0 Y9 \
MsgBox("Count of Bodies in select Part: " & body_count)
; n% x1 u' f# f! B ?1 G+ W% o. q ^; D8 q
但是提示错误信息,
- i; v. l M- g L! N'part' is not a member of 'NXopen.Assemblies.Component'.
, K. S( b; {$ E8 ~& v! e
! j0 S0 W3 l3 i0 o/ A我没办法查看帮助文档(公司电脑没有管理员权限不让装),请各位路过的高手帮小弟看看怎么改,多谢了~~~~~~~~~~~~~~~~~~ |
|