Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

CATIA Macro 3dxml to CatProduct is deformed

Status
Not open for further replies.

kroma25

Automotive
Sep 9, 2021
1
Hi,
I wrote a macro that reads a 3dxml file and exports CATProduct, but the exported file is garbled. I run the macro through powershell. Everything is done in batch mode. Interestingly, the same macro works fine with open CATI (no batch mode), and it is even more interesting that on another laptop my macro in batch mode works fine. I tested the macro on CATI R23, R28, R29. Has anyone had such a problem and knows how to solve it?

PowerShell Command:

Code:
$macroPath = "C:\Users\QTSWISS\Visual_Studio_Code\Test.catvbs"
$CMD = "C:\Program Files\Dassault Systemes\B28\win_b64\code\bin\CATSTART.exe"
$arg1 = "-env"
$arg2 = "CATIA_PLM_Express.V5-6R2018.B28"
$arg3 = "-direnv"
$arg4 = "C:\ProgramData\DassaultSystemes\CATEnv"
$arg5 = "-run"
$arg6 = "CNEXT -batch -macro $macroPath"

& $CMD $arg1 $arg2 $arg3 $arg4 $arg5 $arg6

Catia Marco:

Code:
Language="VBSCRIPT"

Sub CATMain()

Set documents1 = CATIA.Documents

Set document1 = documents1.Open("C:\Konwerter\Pliki_testowe\Uszkodzony2.3dxml")

Set productDocument1 = CATIA.ActiveDocument

productDocument1.SaveAs "C:\Konwerter\Pliki_testowe\u\Uszkodzony2.CATProduct"

End Sub

image_2021_09_09T13_26_38_782Z_s6lbyz.png


image_2021_09_09T13_25_55_135Z_lqwt8u.png



LINK to file: Link
 
Replies continue below

Recommended for you

Status
Not open for further replies.

Part and Inventory Search

Sponsor