I need to write a macro in Catia 5. My aim is to convert cgm files to png at the desired background color and at desired resolution. Manually I am doing it by Capture->image->options(setting resolution and background color)-> save as .
I need to do it by macro.
I can open the Capture window with CATIA.StartCommand "Capture" but can not proceed furthermore. How can I proceed?
Thanks in advance.
HOW WE CAN USE COMMANDS WHICH ARE GIVEN IN OBJECT BROWSER IN MACRO? I AM DIRECTLY WRITING IT BUT DOES NOT WORK.
Unfortunately, the Capture command does not seem to be available through the macro API. I've successfully used this workaround, however:
It works by temporarily changing the background color (among other things, such as spec. tree visibility, rendering mode and camera settings) and by using the
CaptureToFilemethod. By changing the window size, you also change the dimensions of the captured image. Unfortunately, it cannot capture to PNG format (even though the interactive Capture tool can). This version instead captures to BMP. The JPEG mode compresses the picture beyond reason and is unusable. The compass will be visible in the pictures captured with this macro, if it is enabled in the interactive session.