|
马上注册,结识高手,享用更多资源,轻松玩转三维网社区。
您需要 登录 才可以下载或查看,没有帐号?注册
x
我用SelectWithSingleDialog选中一个component得到component_tag,想要得到所选component中body的数量,代码如下:
5 T. x ^& a6 A5 {2 n2 }* i* K
# L8 ^3 d$ c7 S) [ Dim component_tag As NXOpen.Tag
# X B$ }$ g, [ Dim component1 As Assemblies.Component3 A! r, C" |$ r4 @ k) v8 Q
Dim all_bodies() As Body 3 ]: o( `9 p$ |) h" `% q+ V: Q* ?# K3 J
Dim body_count As Integer0 |0 Z8 G6 [0 y" E
SelectWithSingleDialog(.......component_tag...........)(此处省略)1 V. Z! h7 \0 Y5 o% e' s
component1 = ctype(NXObjectManager.Get(component_tag), Assemblies.Component)0 u! K. C- K; r) D) m# K/ ~
all_bodies=component1.Bodies.ToArray()
% D. }3 o, C/ _) W* r; [ body_count=all_bodies.length" D+ p5 {) e. X, A+ d7 h; \% U
MsgBox("Count of Bodies in select Part: " & body_count)
* D! M; D. H* m9 |" K: B+ S( O
4 O: a: i1 b* n) O2 O- `; X+ b' s但是提示错误信息,
4 L, m8 r$ {! F0 T2 C: v% ]3 M, m4 ~'part' is not a member of 'NXopen.Assemblies.Component'.
+ Z# c; B' y! E" o p
/ _! B z3 m; n) I我没办法查看帮助文档(公司电脑没有管理员权限不让装),请各位路过的高手帮小弟看看怎么改,多谢了~~~~~~~~~~~~~~~~~~ |
|