|
|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我用SelectWithSingleDialog选中一个component得到component_tag,想要得到所选component中body的数量,代码如下:- J Y1 w& e. g
5 @; S" C: @- Q+ E& O& c Dim component_tag As NXOpen.Tag) r* M D+ b! e3 E, s7 k
Dim component1 As Assemblies.Component1 F9 B3 X& M5 ?! R7 G4 H- }. |
Dim all_bodies() As Body
7 }) P1 _6 r/ l, {% J* T8 D Dim body_count As Integer
8 \* i; r0 c$ I+ ^ SelectWithSingleDialog(.......component_tag...........)(此处省略)5 |4 i, R0 {- t- S) R
component1 = ctype(NXObjectManager.Get(component_tag), Assemblies.Component)
+ J9 H2 Z, [0 ?$ y' a5 V7 n! x y all_bodies=component1.Bodies.ToArray()1 Y e3 Y0 n: ^5 o8 ]
body_count=all_bodies.length
o L, k. c% B9 D1 u2 J MsgBox("Count of Bodies in select Part: " & body_count)4 H' q5 m4 H% p) \8 d! q
0 p: A$ ^$ O0 \9 \8 u$ X* H6 O' J
但是提示错误信息,
' U0 {+ u/ ?; j7 ?% M: u& C0 U; Q'part' is not a member of 'NXopen.Assemblies.Component'.
# V7 H6 e3 {8 |
" I% h- x6 n9 b# @! f9 s我没办法查看帮助文档(公司电脑没有管理员权限不让装),请各位路过的高手帮小弟看看怎么改,多谢了~~~~~~~~~~~~~~~~~~ |
|