Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Test if Inventor Server is running

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
JBerns
988 Views, 4 Replies

Test if Inventor Server is running

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

-----------------------------------------------------------------------------------------
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
4 REPLIES 4
Message 2 of 5
freesbee
in reply to: JBerns

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 Frison
CAD R&D // PDM Admin · Hekuma GmbH
Message 3 of 5
JBerns
in reply to: freesbee

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:

http://au.autodesk.com/au-online/classes-on-demand/class-catalog/classes/year-2017/inventor-lt/ci123...

 

Thanks again for looking into this. I look forward to your reply.

 

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Message 4 of 5
freesbee
in reply to: JBerns

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 Smiley Happy ), but I imagine that with a small adjustment it might solve your issue.

Hope it helps, but kudos and solutions are always welcome Smiley Very Happy

P.S: interesting presentation!!

Massimo Frison
CAD R&D // PDM Admin · Hekuma GmbH
Message 5 of 5
JBerns
in reply to: freesbee

@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

-----------------------------------------------------------------------------------------
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report