求兼容Catia V5的GSA「External Storage Clean-up」功能VB命令行
GSA「External Storage Clean-up」的CATIA V5 VBA命令行实现
GSA的「External Storage Clean-up」功能支持通过CATIA V5的VBA命令行调用,你可以直接利用GSA的API实现该操作。
实现代码示例
Sub GSExternalStorageCleanup() Dim gsaApp As Object Dim gsaModel As Object ' 获取或启动GSA应用实例 On Error Resume Next Set gsaApp = GetObject(, "GSA.Application") On Error GoTo 0 If gsaApp Is Nothing Then Set gsaApp = CreateObject("GSA.Application") End If ' 获取当前激活的GSA模型 Set gsaModel = gsaApp.Models.ActiveModel ' 执行外部存储清理操作 gsaModel.ExternalStorage.Cleanup ' 释放对象资源 Set gsaModel = Nothing Set gsaApp = Nothing MsgBox "External Storage Clean-up 执行完成", vbInformation End Sub
注意事项
- 运行前需确保CATIA V5已加载GSA插件,且存在激活的GSA模型
- 该操作会移除模型中未被引用的外部存储数据,有效减小模型文件体积
- 若需批量处理多个模型,可循环遍历
gsaApp.Models集合调用清理方法
内容的提问来源于stack exchange,提问作者Joël Teixeira Alves
相关产品推荐
相关产品推荐

