|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我用SelectWithSingleDialog选中一个component得到component_tag,想要得到所选component中body的数量,代码如下:
. n' t; t2 ^8 @' x4 f/ f2 j; g4 o
9 m& g* @6 r" g6 Z; } Dim component_tag As NXOpen.Tag
, w' T$ X1 w m3 Z3 r, r Dim component1 As Assemblies.Component
3 Q t" s- ]# v1 ]' N Dim all_bodies() As Body 0 N% |. |: M+ j% }' V, \% K' b3 L9 Y) X
Dim body_count As Integer* j3 {2 I& Z6 g* C1 p: ?4 U
SelectWithSingleDialog(.......component_tag...........)(此处省略)
+ [3 K- V! u% ~& w4 K component1 = ctype(NXObjectManager.Get(component_tag), Assemblies.Component)
" l2 V! L" I5 K, q/ b1 ]( ` all_bodies=component1.Bodies.ToArray()7 S" Y% }% N; l. i* G
body_count=all_bodies.length O/ x3 }# L; `7 q* B# o
MsgBox("Count of Bodies in select Part: " & body_count)+ Q3 q0 A# q- H1 Q
4 N* e' n) H$ S! S& \2 J
但是提示错误信息,
4 ^+ }- d- ~: d8 N'part' is not a member of 'NXopen.Assemblies.Component'.
/ d* L9 P& g4 b. a$ b! i7 |' F" f: i' h
我没办法查看帮助文档(公司电脑没有管理员权限不让装),请各位路过的高手帮小弟看看怎么改,多谢了~~~~~~~~~~~~~~~~~~ |
|