Running Inventor from a command line, load a specific model, then csv file

ron.c
Advocate

Running Inventor from a command line, load a specific model, then csv file

ron.c
Advocate
Advocate

What is the best workflow for loading a model from a command line script, then reading parameters from a csv file (or Excel) and updating the model based on those parameters?

 

Thanks in advance!

0 Likes
Reply
2,018 Views
9 Replies
Replies (9)

Mark.Lancaster
Consultant
Consultant

Workflow will most likely be a program...  You could probably launch this through the Inventor Task scheduler and then have a trigger launch an iLogic program that reads the CSV file   Do you have any programing experience or ever used the Inventor Task Scheduler?

 

Also what are you trying to accomplish?  Are you trying to generate standard models based on orders?   My line of questioning is leading up to Configurator 360.

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes

ron.c
Advocate
Advocate

I am working on building a online configurator.

 

We started with C360, but I have lost faith in it (and Autodesk) because they drastically changed the terms of use for C360 (and most of their products).  We spent a lot of time preparing to use C360 and they eliminated the $300 / quarter terms (which worked great during development) and made the $3000 / year package the entry level program.

 

What's next?  With ETO and the acquisition of ConfigureOne, I'm left wondering if C360 will even be around in a few years.

 

That's why we want to develop our own system.

 

I am a PHP / MySQL / Javascript programmer -- that's what I know, so I want to build a configurator around those technologies.   PHP can be used to run a command line script to start the process.  

 

The idea is to allow the web user to fill out a form, selecting the product features, and write the selections to a csv or Excel file, then use PHP to start Inventor (dedicated to this purpose so no licensing terms are violated) with a command line parameter that loads a model set up to read the csv file with the parameters.  Probably iLogic could then be used to do whatever else needs to be done, like generate drawings.

 

The next thing I need to figure out is how to use a command line to start Inventor with a specific model. 

 

Then I need to figure out how to make it read a csv file and configure the model based on the contents of the csv file.

 

Any help would be appreciated!

 

- Ron

 

 

0 Likes

Anonymous
Not applicable

HI Ron C

 

Have you figured out how to do what your asking?

 

Thanks

0 Likes

ron.c
Advocate
Advocate

No, we are still looking for a solution...

 

- Ron

0 Likes

Anonymous
Not applicable

Hi Ron C

 

Please tell me you have figured out something new or and advance about this topic

 

Thanks 🙂

0 Likes

Patrick.Gruber
Enthusiast
Enthusiast

Here is a powershell snippet how you can open Inventor and load a part:

 

Start-process -FilePath "C:\Program Files\Autodesk\Inventor 2018\Bin\Inventor.exe" -ArgumentList @("/i C:\Users\patrick.gruber\Desktop\Standard.ipt") -Wait
Please mark this response as "Accept as Solution" if it answers your question.
If you have found any post to be helpful, even if it's not a direct solution, then please provide that author kudos!
😉
The author,
Patrick

coolOrange
www.coolOrange.com
0 Likes

erik
Explorer
Explorer

is there an overview of the available argumentlist options?

 

many thanks

 

0 Likes

Anonymous
Not applicable

Dunno if this topic is active in any way.

But I would suggest using vbScript to create an inventor application, open the file and change the parameters.

 

vbscript files can be simply created using any text editor and store them as .vbs

This script can be used to create an inventor instance:

 

 

 

Dim oInvApp
set oInvApp = CreateObject("Inventor.Application")
oInvApp.Visible = True 'if you like to see what it is doing

Dim oInvDoc 'EDIT this was previously declared as Inventor.Document.
'But that is not allowed as no reference to inventor is set.
set oInvDoc = oInvApp.Documents.Open("string to part, which can be passed using arguments")

'do further stuff here

Call oInvApp.Quit 'close inventor

 

 

 

 

I know for sure it is possible to load an inventor vba library and run a macro from this library, so you could even keep this code compact and do the csv update using inventor vba (however, I am not certain if passing arguments is possible). In the command prompt, you can run this file using (assuming you have set the cd to the drive in which the .vbs script is located):

 

 

 

cscript myVBscript.vbs

 

 

 

About passing arguments using this method, I suggest looking into this page: 

https://stackoverflow.com/questions/2806713/can-i-pass-an-argument-to-a-vbscript-vbs-file-launched-w...

 

Hope this helped,

Peter Verheijen

 

EDIT: changed the code slightly, see the EDIT there for what I changed. it is important to note that vbScript does not have the option to add references, so everything must be an undefined object. Because of this I do strongly advice to keep the most crucial parts of the code in an environment that does allow declaring variable types (such as inventor vba)

 

JBerns
Advisor
Advisor

Anonymous,

 

Thanks for sharing the VBS script. This will save a lot of time when selecting a template that is several folders deep.

 

Regards,

Jerry

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