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: 

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

8 REPLIES 8
Reply
Message 1 of 9
ron.c
1756 Views, 8 Replies

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

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!

8 REPLIES 8
Message 2 of 9
Mark.Lancaster
in reply to: ron.c

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.

Message 3 of 9
ron.c
in reply to: Mark.Lancaster

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

 

 

Message 4 of 9
Anonymous
in reply to: ron.c

HI Ron C

 

Have you figured out how to do what your asking?

 

Thanks

Message 5 of 9
ron.c
in reply to: Anonymous

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

 

- Ron

Message 6 of 9
Anonymous
in reply to: ron.c

Hi Ron C

 

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

 

Thanks 🙂

Message 7 of 9
Patrick.Gruber
in reply to: ron.c

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
Message 8 of 9
erik
in reply to: Patrick.Gruber

is there an overview of the available argumentlist options?

 

many thanks

 

Message 9 of 9
Anonymous
in reply to: ron.c

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)

 

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

Post to forums  

Autodesk Design & Make Report