Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Windows does things differently when apps are run through the task manager.
You do not have any mapped drives, etc.
Take that into account in your application.
Can you explain for what purpose you need to run Windchill/Creo as a task?
I want Creo to process a batch of files and report symbols that occur on drawings. Since there are many files (1000's), I thought it would be best to start Creo, process say 20 drawings, and then restart and cleanup the cache. This way there should not be any problems caused by disk space or full memory.
Not sure, but couldn't you just clear the memory after certain number of files instead of restarting Creo?
Automate:
File
Manage session
Erase Not Displayed
I used a trail file to run through hundreds of drawing files in order to generate DXF files. This was all done in one session. The trick is exactly what was suggested; to close all the opened files, then use
File->Manage Session->Erase Not Displayed
after each file was processed. Otherwise you'd hit a limit on opened files, or other undesirable failures. The only inescapable problems were the files that were saved in an incomplete or failed state by whoever created them.
@KenFarley wrote:
I used a trail file to run through hundreds of drawing files in order to generate DXF files. This was all done in one session. The trick is exactly what was suggested; to close all the opened files, then use
File->Manage Session->Erase Not Displayed
after each file was processed. Otherwise you'd hit a limit on opened files, or other undesirable failures. The only inescapable problems were the files that were saved in an incomplete or failed state by whoever created them.
Hi,
Erase Not Displayed command does not free RAM as expected. If you run a trail file that repeats a certain operation for 1000 files, you will see that the RAM keeps growing even if Erase Not Displayed command is applied.
That's dissapointing. Then what purpose does the erase no displayed command serve, I wonder? I guess it shortens the "In Session" model list, but I was always under the assumption that it was freeing up memory from large models I no longer am working with.
@KenFarley wrote:
That's dissapointing. Then what purpose does the erase no displayed command serve, I wonder? I guess it shortens the "In Session" model list, but I was always under the assumption that it was freeing up memory from large models I no longer am working with.
Hi,
yes, that's dissapointing. But that's how it works.
For sure the memory which is allocated gets freed, but due to the fact that PTC is actively managing the memory by themselves, you will not see this. If you would write an application like Creo you would do this as well. Once you have the memory, reuse it, don't give it away to the OS. That means, erase not display, is still recommended 🙂 if you open hundreds of files and work on it. But even this has limitations and you may crash 🙂
You can’t start Creo in that way, either with parametric.exe plus psf or just start the batch, The Creo exe is since years the xtop.exe, no idea why this was never changed. And yes g:no_graphics -i:rpc_input this args are required as well. This args must be given to the xtop. If you just start the parametric.exe you need to know which keys you want to use. Try it by yourself.
Hi,
login to PTC Support and use following link
https://www.ptc.com/en/support/search/#q=g%3Ano_graphics
In CS300745 I found following information ...
Creo Parametric when launched with -g:no_graphics is made to run a trail file
This means you can:
1.] generate trail file
2.] run batch file containing parametric.exe -g:no_graphics PATH_to_trail_file
@MartinHanak @your answer is off topic, he tries to create an asynchronous session, and this does not work because the specified Creo command is invalid, as far I can see.
create batch file to open the creo. and call this batch file in the Task sheduler with repeat interval timings , and set it dont start a new instance.
I'm not sure what the Windows Task Scheduler adds/removes to/from the environment of a task (others named mapped network drives).
(Maybe a graphical desktop session is "promised" to exist for the task somehow, but not present in your use case?)
Maybe the PTC TOOLKIT related COM service does not work in this context? From VB/VBA/.NET, the connection to Creo is established via the Windows COM technique.
If you can, try the C/C++ (both paid) or Java OTK (free/paid) API avoiding COM. (Sorry, this is a workaround, not a solution.)
We successfully automated Creo for processing 10k..100k objects with an asynchronous Pro/TOOLKIT (C/C++) application, with and without Windchill.
Creo stability issues occurred (despite erasing everything from session), too, but are prevented by restarting Creo every 500..1000 processed objects. During this restart, all PTC/Creo related interprocess communication processes are killed and caches are cleared (to have a clean next Creo start).
This works in a context of an interactive desktop session and also in a no-graphics Windows Service context using this tool chain:
Create/configure a Windows Service with something like, for example, nssm.exe ( https://nssm.cc/download )
nssm -> Java application -> batch script (incl. kill-script/cache reset etc.) -> ansynchronous TOOLKIT application -> Creo
(It works without the Java application, too.)
This service runs as a user, created only for this purpose.
Where exactly and with what error code/exception fails the connection attempt?
try autologon registry hack - this will take care of task scheduler 'run whether user...' property
try to run creo without 'no_graphics' switch, if possible, otherwise creo will run in WIN32_GDI graphics mode and that may cause you some grief...
try not to run your vbs app directly from the task scheduler - create a wrapper batch or powershell script and set task's property to allow interaction - this will help with debugging
you could try to use tasklist and taskkill commands or powershell ...-Process cmdlets to clear up memory when a creo footprint exceeds some given limit