|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我用SelectWithSingleDialog选中一个component得到component_tag,想要得到所选component中body的数量,代码如下:% G; a, @* L7 g/ B7 p3 X
: q) ~+ U. N5 ~
Dim component_tag As NXOpen.Tag7 t- R: |5 U& i, o1 M$ F! |' U# R5 v
Dim component1 As Assemblies.Component
" t% H! ^5 Z% y3 z Dim all_bodies() As Body ; c C; z4 Z# k- ]
Dim body_count As Integer( p# l$ k# x5 g5 E5 y6 q% m; [
SelectWithSingleDialog(.......component_tag...........)(此处省略)
* L, p* V$ N% h# i component1 = ctype(NXObjectManager.Get(component_tag), Assemblies.Component)
# B1 @& b& K1 a all_bodies=component1.Bodies.ToArray()# h% R% d/ _" W& |: W' I
body_count=all_bodies.length+ g2 V& p4 F' l
MsgBox("Count of Bodies in select Part: " & body_count)
+ E) ~) k) z3 b s g" p
/ c- o @3 [& ~# x9 w; T但是提示错误信息,
, G$ i, r5 X) o3 m$ k& i'part' is not a member of 'NXopen.Assemblies.Component'.8 v! y2 p% [5 E7 P
/ h p$ u7 M. l+ q; m0 G) _
我没办法查看帮助文档(公司电脑没有管理员权限不让装),请各位路过的高手帮小弟看看怎么改,多谢了~~~~~~~~~~~~~~~~~~ |
|