CATIA中导出参数值到excel或者txt文本的两种方法 您所在的位置:网站首页 清明节时间用英语怎么表达 CATIA中导出参数值到excel或者txt文本的两种方法

CATIA中导出参数值到excel或者txt文本的两种方法

2024-05-10 01:35| 来源: 网络整理| 查看: 265

Sub ExportParametersToCSV()

 Dim sPath As String

 sPath = CATIA.FileSelectionBox("Export Parameters to .csv", "*.csv", CatFileSelectionModeSave)

 Dim oSelection

 Set oSelection = CATIA.ActiveDocument.Selection

 CATIA.Interactive = False

 oSelection.Clear

 oSelection.Search "Knowledgeware.Parameter,all"

 Open sPath For Output As #1

 Dim i As Integer

 For i = 1 To oSelection.Count

 Dim oSelectedElement As SelectedElement

 Set oSelectedElement = oSelection.Item(i)

 Dim sElementName As String

 sElementName = oSelectedElement.Value.Name

 Dim sElementPath As String

 sElementPath = oSelectedElement.Value.Value

 sLine = sElementName + "," + sElementPath

 Print #1, sLine

 Next

 oSelection.Clear

 CATIA.Interactive = True

 Close #1

 MsgBox "Done"

End Sub



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有