QQ登录

只需一步,快速开始

登录 | 注册 | 找回密码

三维网

 找回密码
 注册

QQ登录

只需一步,快速开始

展开

通知     

全站
4天前
查看: 1282|回复: 4
收起左侧

[求助] 选中component后遍历该component的body,带源码

[复制链接]
发表于 2011-1-21 15:45:16 | 显示全部楼层 |阅读模式 来自: LAN

马上注册,结识高手,享用更多资源,轻松玩转三维网社区。

您需要 登录 才可以下载或查看,没有帐号?注册

x
我用SelectWithSingleDialog选中一个component得到component_tag,想要得到所选component中body的数量,代码如下:, u, i( f! F5 U

* Z8 u. z# v2 @0 D% l4 `" _        Dim component_tag As NXOpen.Tag
7 C8 k6 Z' ]$ t* m3 p9 a        Dim component1 As Assemblies.Component4 d# |) h/ N: ^* A
        Dim all_bodies() As Body
' E; i) s) {" R: _( }& S/ c        Dim body_count As Integer6 O2 I5 R: I$ p, U& a0 x. ^4 v
        SelectWithSingleDialog(.......component_tag...........)(此处省略)
/ v- a$ ?. c4 h        component1 = ctype(NXObjectManager.Get(component_tag), Assemblies.Component)8 S0 Y, a% m& \1 t9 G" Q1 P! J
        all_bodies=component1.Bodies.ToArray()
  }+ a# j; j9 b( x' N        body_count=all_bodies.length% g0 D0 F2 S  Y  s( J7 Q% l8 G1 m/ u
        MsgBox("Count of Bodies in select Part: " & body_count)' t, {6 ^  L2 m7 U4 I9 e

9 ~/ U; W' C2 \0 D; w4 O1 ^# r) b但是提示错误信息,$ R0 J( l  A$ |7 z
'part' is not a member of 'NXopen.Assemblies.Component'.
0 T$ L) X+ O- T& g/ {& y  n/ I0 y4 L6 A$ ]
我没办法查看帮助文档(公司电脑没有管理员权限不让装),请各位路过的高手帮小弟看看怎么改,多谢了~~~~~~~~~~~~~~~~~~
 楼主| 发表于 2011-1-21 22:31:26 | 显示全部楼层 来自: 中国江苏苏州
有哪位大哥知道啊,期待高手啊
 楼主| 发表于 2011-1-22 09:34:10 | 显示全部楼层 来自: LAN
我顶,急煞我也
 楼主| 发表于 2011-1-22 13:31:22 | 显示全部楼层 来自: LAN
高手啊高手,千呼萬喚快出來。。。。。
 楼主| 发表于 2011-1-23 21:35:00 | 显示全部楼层 来自: 中国江苏苏州
。。。。。。。。。。。。。。。。。。。。。。。
发表回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Licensed Copyright © 2016-2020 http://www.3dportal.cn/ All Rights Reserved 京 ICP备13008828号

小黑屋|手机版|Archiver|三维网 ( 京ICP备2023026364号-1 )

快速回复 返回顶部 返回列表