Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catia Export Specification Tree to Excel or text file

Status
Not open for further replies.

NaWin55

Mechanical
Mar 21, 2020
97
IN
Hello
I have created this macro to export Specification tree from catia to excel or text file format
but i am getting this error and i dont know how to correct it
here is the VBSCRIPT

Option Explicit

Sub CATMain()

'Launguage - VB SCRIPT
'Macro - Export Specification tree
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'Declare Variables
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim myDoc As Document
Dim myPart As Part
Dim partDoc As PartDocument

'Set Variables Values
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Set myDoc = CATIA.ActiveDocument
Set myPart = CATIA.ActiveDocument.Part
Set partDoc = CATIA.ActiveDocument


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Export Script
Dim exportFormat As String
exportFormat = InputBox("Enter the format to export the tree as._ type 'xls' or 'txt'")

If exportFormat <> "xls" Then

If exportFormat <> "txt" Then

MsgBox "Did not enter the file format"

Else

Dim partName As String
partName = InputBox("Enter the name of the part")

Dim location As String
location = "D:\CatiaMacro"
partDoc.ExportData location & partName & "." & exportFormat, "txt"

End If
End If

End Sub

Here is the Error
Error_jpfk5h.jpg

Thanks in advance
 
Replies continue below

Recommended for you

Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top