You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求兼容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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 18:15:46