You can automate Data exchanges with DXF using VBScript macros either at import or export. | |
Import |
|
|
|
|
|
You can transfer several files within the same VBScript
macro, but it is recommended to do only one transfer per VBScript macro. |
|
ExampleVBScript macro for implementing a DXF file Language="VBScript" Sub CATMain() Dim Document0 As Document ' Reading an DXF file Set Document0 = CATIA.Documents.Open ( "E:\tmp\Box.dxf" ) ' Saving the corresponding CATDrawing CATIA.ActiveDocument.SaveAs "E:\tmp\Box" CATIA.Quit End Sub |
|
|
|
Export |
|
|
|
The input files must be writable (not read
only). Otherwise the system will display an information box and wait for an acknowledge. The output file must not exist in the output
directory otherwise the system will ask for a confirmation |
|
You can transfer several files within the same
VBScript macro, but it is recommended to do only one transfer per VBScript macro. |
|
ExampleVBScript macro for exporting a CATDrawing file to DXF Language="VBScript" sub CATMain() Dim PartDocument0 As Document ' Reading a CATDrawing file Set PartDocument0 = CATIA.Documents.Open ( "E:\tmp\Box.CATDrawing" ) ' Saving the part in a DXF file PartDocument0.ExportData "E:\tmp\Box2", "dxf" CATIA.Quit End Sub |
|
|