|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我用SelectWithSingleDialog选中一个component得到component_tag,想要得到所选component中body的数量,代码如下:) z! A+ A+ J- f, i$ P. n
7 f6 M; Y+ l1 A: F/ Z! P
Dim component_tag As NXOpen.Tag3 `% d; J0 W2 o# _. d3 E0 ^
Dim component1 As Assemblies.Component# j; e( n; ~8 P" k9 u$ e
Dim all_bodies() As Body 1 S) f7 T. {' N
Dim body_count As Integer
4 t/ p+ U1 [2 |9 ^ SelectWithSingleDialog(.......component_tag...........)(此处省略)
* |& ^/ F& f7 |6 X- _+ H component1 = ctype(NXObjectManager.Get(component_tag), Assemblies.Component)4 }' g8 m9 p' P0 c
all_bodies=component1.Bodies.ToArray()
! ]0 ^: w- r4 Z* [% S body_count=all_bodies.length2 Z; I9 u# K7 N. L
MsgBox("Count of Bodies in select Part: " & body_count)
V4 |2 L; S: U4 H1 U1 I
8 }1 p( K" C$ o( |但是提示错误信息,$ x3 Z* |' @( b! \
'part' is not a member of 'NXopen.Assemblies.Component'.' x" y: }& m8 \& ]! d
5 U: {) H' |* {, Y4 G6 R- J) f, k/ J我没办法查看帮助文档(公司电脑没有管理员权限不让装),请各位路过的高手帮小弟看看怎么改,多谢了~~~~~~~~~~~~~~~~~~ |
|