L3munoz
Industrial
- Aug 29, 2011
- 26
Hi everybody,
I'm just starting working with CATIA macros, and I wrote my first CATScript. Just a simple one to open CATIA and to create a new part document and activate it. Please, see below the code. The problem is when I try to run it I get two errors. The first one, when I write in the command line
cd "C:\Program Files (x86)\Dassault Systemes\B19\intel_a\code\bin" CNEXT.exe -batch -macro "C:\Users\mjorge\Documents\iWork\Test.CATScript"
(believe me the path is correct) the message I receive is "The filename, directory name or volume label syntax is incorrect"
The second one, if I just click twice the CATScript file to execute it, it seems there is an error in line 29, the one in which appears Sub CATMain()!! How can it be wrong?? Any idea??
Thanks in advance...
Language="VBSCRIPT"
'-----
' Open CATIA Application
'-----
Function OpCATIA() As Object
Dim CATIA As Object
Set CATIA = CreateObject("CATIA.Application")
CATIA.Visible = True
Set OpCATIA = CATIA
End Function
'-----
' Create and activate new Part Document
'-----
Function GetCATIAPartDocument() As Object
Set CATIA = OpCATIA
Dim AuxPartDocument As Object
CATIA.Documents.Add("Part")
CATIA.Documents.Item(1).Activate
Set AuxPartDocument = CATIA.ActiveDocument
Set GetCATIAPartDocument = AuxPartDocument
'-----
'MAIN PROGRAM
'-----
Sub CATMain()
GetCATIAPartDocument
End Sub
I'm just starting working with CATIA macros, and I wrote my first CATScript. Just a simple one to open CATIA and to create a new part document and activate it. Please, see below the code. The problem is when I try to run it I get two errors. The first one, when I write in the command line
cd "C:\Program Files (x86)\Dassault Systemes\B19\intel_a\code\bin" CNEXT.exe -batch -macro "C:\Users\mjorge\Documents\iWork\Test.CATScript"
(believe me the path is correct) the message I receive is "The filename, directory name or volume label syntax is incorrect"
The second one, if I just click twice the CATScript file to execute it, it seems there is an error in line 29, the one in which appears Sub CATMain()!! How can it be wrong?? Any idea??
Thanks in advance...
Language="VBSCRIPT"
'-----
' Open CATIA Application
'-----
Function OpCATIA() As Object
Dim CATIA As Object
Set CATIA = CreateObject("CATIA.Application")
CATIA.Visible = True
Set OpCATIA = CATIA
End Function
'-----
' Create and activate new Part Document
'-----
Function GetCATIAPartDocument() As Object
Set CATIA = OpCATIA
Dim AuxPartDocument As Object
CATIA.Documents.Add("Part")
CATIA.Documents.Item(1).Activate
Set AuxPartDocument = CATIA.ActiveDocument
Set GetCATIAPartDocument = AuxPartDocument
'-----
'MAIN PROGRAM
'-----
Sub CATMain()
GetCATIAPartDocument
End Sub