Greetings,
Autodesk Infrastructure Parts Editor (IPE) requires Inventor Server to start before using IPE.
I wrote a batch file to start Inventor Server and then IPE.
My concern is that each time I run the batch file, is another instance of Inventor Server being loaded in memory?
Is there a way to test if Inventor Server is running? If so, could I add the test in the batch file to skip the server load.
Thanks for your time and attention. I look forward to your replies.
Regards,
Jerry
Solved! Go to Solution.
Solved by freesbee. Go to Solution.
Hi!
If you are so kind to post (or send me) the batch file I am quite sure that I can give you a proper solution to your task.
Massimo
Massimo,
Thanks for following-up on this request. Here is the batch file, Launch_IPE.bat, I showed at AU2017:
"C:\Program Files\Autodesk\InfraWorks\ParametricGenerator\Inventor Server\Bin\InventorFCADServer.exe"
TIMEOUT 3
cd "C:\Program Files\Autodesk\Infrastructure Parts Editor\Bin\"
start InfrastructurePartsEditor.exe
Source:
Thanks again for looking into this. I look forward to your reply.
Regards,
Jerry
ok, so first the answer, then my comments.
Unfortunately I cannot give you the specific answer because you are dealing with 2 processes, and I do not know which one you want to test, but in principle you want to do an action if a condition is true. I will give you an example syntax that you will easily adapt to your specific situation depending on what you want to test.
The Solution First
The following syntax will tell you if a process (for example calculator.exe) is running or not:
@tasklist /NH | find /I "calculator.exe" >nul 2>&1 && ( @echo. @echo. Calculator is running @echo. ) || ( @echo. @echo. Calculator is NOT running @echo. )
clearly, you can use this syntax to launch calculator in case it is not running:
@tasklist /NH | find /I "calculator.exe" >nul 2>&1 && ( @echo. @echo. Calculator is running, no action needed @echo. ) || ( @echo. @echo. Calculator is NOT running, so I will start it
calc @echo. )
it can be easily compacted in one line as follows:
tasklist /NH | find /I "calculator.exe" >nul 2>&1 && ( @echo. Calculator is running ) || ( calc )
(you wouldn't even need parentheses in this case)
and even more compact as:
tasklist /NH | find /I "calculator.exe" >nul 2>&1 || ( calc )
You only need to make sure that the process that you want to check is being executed by the same user that is launching the cmd file (if not let me know, because then it would get more interesting).
My comments now
1. calc is in the path, but if you want to start processes which are not in the path you'd better call them with FQFN:
tasklist /NH | find /I "InventorFCADServer.exe" >nul 2>&1 || ( "%PROGRAMFILES%\Autodesk\Infraworks\Parametric Generation\Inventor Server\bin\InventorFCADServer.exe" )
2. in general I would suggest you to avoid "cd" command in batch (it's useless and makes everything slower)
3. you probably have good reasons to start the second process with the "start" command, and this syntax would work also in that case, but I would take a try without the "start" first
4. I suspect that your "timeout" is needed to allow the first process to start before shooting the second one. Clearly by looping this syntax you might be able to check if the first process has started and THEN start the second one, initiating all this only if the first one was NOT running, but maybe it might get a little bit less readable for novices (feel free to contact me if you want to explore that option).
5. I would use .cmd instead of the (oldtimer) .bat
Be aware that I do NOT have those programs installed, so I cannot verify this syntax (ok, except the "calc" one ), but I imagine that with a small adjustment it might solve your issue.
Hope it helps, but kudos and solutions are always welcome
P.S: interesting presentation!!
@freesbee (Massimo),
I am pleased to report that your solution does work at loading the software only once. This will be a good solution for those running the 2018 version of Inventor and IPE.
I was able to test the 2019 product versions and it looks like the batch file will not be necessary.
Thanks for the solution, Massimo.
Kind regards,
Jerry
Can't find what you're looking for? Ask the community or share your knowledge.