cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Need to trigger "OK" button in print dialogue of IsoDraw via macro

RubenCote
3-Visitor

Need to trigger "OK" button in print dialogue of IsoDraw via macro

I need a macro event to trigger the "OK" from the print dialogue box. I wrote the following macro to print the viewports in a drawing, but I have to manually select the "OK" button each time the macro goes to print the active viewport. A bit of a pain since I have between 8-15 viewports per drawing when I print the .cgm drawings I produce. Attached is the code.

8 REPLIES 8

I attempted a similar feat, but was unable. If you find out a way, please post.

On the other hand, are you truly attempting to print the 8-15 viewports to a printer, or are you going to a PDF or similar idea? The reason I ask is that there is often more than one approach to a problem. We might be able to figure out a work-around with some more detail.

Example:

You actually need prints, but want it in a batch configuration. You could instead:

1) Loop through the viewports exporting as a middleman file type.

2) Once all viewports are exported, use the launch command to call a program on your computer to print those files.

3) With a complex enough launch command line you could have it clean up after itself as well.

We did this in 7.0 to produce PDFs. Our PDF macro would export an EPS, a launch command would then kick off acrobat and would convert the EPS to a PDF. Not the prettiest, but it got the job done.

Thanks Trevor for getting back so fast. I was hoping to hear otherwise about this problem, but it appears it's with the actual programming of the current versions of IsoDraw. I've done a workaround in the past where the macro exports the viewports and then I batch print those files straight from the folder the exports went to via a third party program. It's a pain! I've entered an enhancement request with PTC and it appears they are considering it for the 7.2 release, but for now it appears to be a problem that cannot be solved within the IsoDraw program via a macro. Work arounds seem to be the only answer for now. Thanks.

Glad you went the extra mile and submitted it to PTC. I hadn't gone that far.

Just as a reminder, the launch command can be handy for kicking off third party programs. It would at least save you from having to go print them all manually. If you need help, let me know.

Okay, I've tried to use the launch feature but I can't figure how to get Acrobat to print all the files in the folder I exported to. I've attached the .ism file. So far I just print the first exported file over and over again.

Try the attached file. If you run into a problem check the path for Acrobat. My install path is different so I may have mistyped when I keyed your path back in.

That did it. Thanks for the script. Definately a work-around but does the job. Thanks for all the help. Hopefully PTC will include printing viewports in there next release of 7.2.

No problem. Glad it worked and thanks for letting me know.

Here's the final macro to print viewports in IsoDraw 7.1. Place the _tiff folder and the clear_tiff_folder.bat at C:\.

Top Tags