|
我用SelectWithSingleDialog选中一个component得到component_tag,想要得到所选component中body的数量,代码如下:
- [; Y# p' G8 @$ _/ V! a. b1 |
Dim component_tag As NXOpen.Tag; [& v$ T3 p& I5 s! S: k2 Z, ]
Dim component1 As Assemblies.Component
& B% l, d/ k4 _3 X% ~. B2 R9 f+ Y Dim all_bodies() As Body
_' b+ d3 a- [" U& C2 N- | Dim body_count As Integer3 r9 K0 K# _1 p' \) z! Q6 q' P- a
SelectWithSingleDialog(.......component_tag...........)(此处省略)9 J; ], K7 ^! |
component1 = ctype(NXObjectManager.Get(component_tag), Assemblies.Component)
6 Y2 \5 p. K9 m all_bodies=component1.Bodies.ToArray()5 T1 e4 K2 _% E5 G( Q( N% `
body_count=all_bodies.length
- C# o2 W3 g' g0 H$ m4 D MsgBox("Count of Bodies in select Part: " & body_count)6 C7 f3 H) a6 L% ]
" I6 H/ l' P; S( V# k但是提示错误信息,; e, Z$ o& p; {9 c" Y9 L3 I& h
'part' is not a member of 'NXopen.Assemblies.Component'.
% d+ s% X; R; |! H& ?( E" q" J+ O: K* Q ]( ?1 E; [ z ]
我没办法查看帮助文档(公司电脑没有管理员权限不让装),请各位路过的高手帮小弟看看怎么改,多谢了~~~~~~~~~~~~~~~~~~ |
|