|
本帖最后由 ning58 于 2016-1-31 08:35 编辑
- Function ComponentArr(SwModel As ModelDoc2)
- 'Debug.Print SwModel.GetTitle
- Dim oDic As New Dictionary
-
- Dim swRootComp As Component2, SwComp As Component2
- Dim SwRootConf As Configuration, vChildComp, vModel As ModelDoc2
- Set SwRootConf = SwModel.GetActiveConfiguration
- Set swRootComp = SwRootConf.GetRootComponent
- vChildComp = swRootComp.GetChildren
- For ii = 0 To UBound(vChildComp)
- Set SwComp = vChildComp(ii)
- Set oDic(SwComp.GetPathName) = SwComp
- Next ii
- ''
- ComponentArr = oDic.Items
- End Function
- Private Sub ll()
- Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2
- Set SwApp = Application.SldWorks
- Set SwModel = SwApp.ActiveDoc
- Dim Arr, SwComp As Component2
- Arr = ComponentArr(SwModel)
- For ii = 0 To UBound(Arr)
- Set SwComp = Arr(ii)
- With SwComp
- Debug.Print .GetPathName, .Name, .ReferencedConfiguration, .GetSuppression, .IsHidden(True)
- End With
- Next ii
- End Sub
复制代码
运行结果,只能判断是否压缩,没法判断零件是否为轻化。
D:\JB4716\JB4716\立式支座.SldAsm 立式支座-3 耳式支座-1800-12-A8 1 True
D:\JB4716\JB4716\管箱.SLDASM 管箱-1 管箱Dn1800 2 False
D:\JB4716\JB4716\壳体管束φ38.SLDASM 壳体管束φ38-1 壳体管束 Dn1800-38L=2500 2 False
D:\JB4716\JB4716\双头螺柱.SLDPRT 双头螺柱-101 M20×170 1 True
D:\JB4716\JB4716\螺母.SldPrt 螺母-205 M20 1 True
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|