Skip to main content
15-Moonstone
December 4, 2017
Question

Anyone willing to help me make a simple program/listener?

  • December 4, 2017
  • 6 replies
  • 2617 views

I really could use some help creating a simple listener or program or something similar, that when in drawing mode, it would run a mapkey when the user prints or maybe when they save. 

 

I just dont know where to begin. 

 

Thank you

6 replies

1-Visitor
December 5, 2017

It looks like altering Creo fucntionality (Save/Print) and so I think that is prohibited.

But you can 

1. have your own command which will execute the Mapkey and then Save/Print the model.

2. update the menu in have your command instead of Save/Print.

 

2-Explorer
December 5, 2017

May be API ProNotificationSet() would help you.

SYNDAKIT15-MoonstoneAuthor
15-Moonstone
December 6, 2017

sounds like something I would be interested in. 

I am fluent with relations in creo but I would need to be walked through creating and running that program. maybe in VBA?

 

also check out this older thread that I started. It's the same issue but still never resolved. https://community.ptc.com/t5/Creo-Modeling-Questions/Repeat-region-summation/td-p/362172

 

What I am thinking is if I can just have some little program running in the background that runs a mapkey ( I have already created one) just before or just after the user prints/saves. 

16-Pearl
December 6, 2017
Another option without having to use a toolkit type program, would be to write a script that monitors the trail file and sends keystrokes to Creo Parametric (to run the mapkey). We’ve used AutoIT to do just such a thing, but we don’t continuously run the script while Creo Parametric is running. We automate some printing and export functions, and examine the trail file for success/failure messages. We’re only looking at the trail file while the print/export function is active.
SYNDAKIT15-MoonstoneAuthor
15-Moonstone
December 6, 2017

How do you set up autoit to only look at the trail file while the print is active?

16-Pearl
December 6, 2017
We run a menu driven mapkey to print. That mapkey runs an OS command to start the AutoIT program and then return control to Creo Parametric. The AutoIT program is sending keystrokes to Creo Parametric to run additional mapkeys and it monitors the trail file. As MadhaviG mentioned, you can probably avoid the "listener" if you setup your mapkeys to do everything you want, and then have the users use the mapkeys (via a menu pick) to print/save instead of the typical print/save methods. Regards, Dan N.