QQ登录

只需一步,快速开始

登录 | 注册 | 找回密码

三维网

 找回密码
 注册

QQ登录

只需一步,快速开始

展开

通知     

全站
1天前
查看: 838|回复: 0
收起左侧

[求助] 运行时错误438

[复制链接]
发表于 2011-12-6 22:18:50 | 显示全部楼层 |阅读模式 来自: 中国北京

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

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

x
按照官网的代码写到宏里面的,实现FeatureManageTree运行时在Debug.Print "View dependencies     = " & swFeatMgr.ViewDependencies出现错误,请问有遇到这种情况的吗?谢谢大家了'----------------------------------------------------' Preconditions:' 1. Specified document exists.' 2. Open the Immediate window.'' Postconditions:' 1. The FeatureManager design tree's display-related property'    values are shown in the Immediate window.' 2. Examine both the Immediate window and the FeatureManager'    design tree before resuming the macro.' 3. Re-examine both the Immediate window the '    FeatureManager design tree to verify the changes.'' NOTE: Because this assembly document is used' elsewhere, do not save any changes when closing it.'----------------------------------------------------Option ExplicitDim swApp As SldWorks.SldWorksDim swModelDoc As SldWorks.ModelDoc2Dim swFeatMgr As SldWorks.FeatureManagerDim document As StringDim errors As LongDim warnings As LongSub main()document = "C:\Program Files\SolidWorks Corp\SolidWorks\samples\tutorial\advdrawings\bladed shaft.sldasm"Set swApp = Application.SldWorksSet swModelDoc = swApp.OpenDoc6(document, swDocASSEMBLY, swOpenDocOptions_Silent, "", errors, warnings)Set swFeatMgr = swModelDoc.FeatureManagerDebug.Print "----------------- Before changing FeatureManager design tree properties -----------------"Debug.Print "View dependencies     = " & swFeatMgr.ViewDependenciesDebug.Print "View features         = " & swFeatMgr.ViewFeaturesDebug.Print "Show feature details  = " & swFeatMgr.ShowFeatureDetailsDebug.Print "Show hierarchy only   = " & swFeatMgr.ShowHierarchyOnlyStop' Examine the Immediate window and' FeatureManager design tree before' resuming the macro' Change details, dependencies, hierarchy, and' features-related properties    If (swFeatMgr.ViewDependencies) Then        swFeatMgr.ViewFeatures = True    Else        swFeatMgr.ViewDependencies = True    End If        If (swFeatMgr.ShowFeatureDetails) Then        swFeatMgr.ShowHierarchyOnly = True    Else        swFeatMgr.ShowFeatureDetails = True    End If    Debug.Print "----------------- After changing FeatureManager design tree properties -----------------"Debug.Print "View dependencies     = " & swFeatMgr.ViewDependenciesDebug.Print "View features         = " & swFeatMgr.ViewFeaturesDebug.Print "Show feature details  = " & swFeatMgr.ShowFeatureDetailsDebug.Print "Show hierarchy only   = " & swFeatMgr.ShowHierarchyOnlyEnd Sub
发表回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则


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

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

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