Import in an .ipt using iLogic

Import in an .ipt using iLogic

peterjoachim
Enthusiast Enthusiast
968 Views
6 Replies
Message 1 of 7

Import in an .ipt using iLogic

peterjoachim
Enthusiast
Enthusiast

What I'm trying to do is create a .ipt template that, when creating a new .ipt using the template, will automagically open the Manage/Insert/Import command (see screenshot) along with a custom form. The form part is easy. I just haven't been able to figure out the Import part. Is this possible?

Import.PNG

0 Likes
Accepted solutions (1)
969 Views
6 Replies
Replies (6)
Message 2 of 7

WCrihfield
Mentor
Mentor

I think the command you are looking for is "AppImportFileCmd".

It is used like this.

 

ThisApplication.CommandManager.ControlDefinitions.Item("AppImportFileCmd").Execute

 

 What I would do is put this into an iLogic rule.  Then on the Manage tab / iLogic panel (within the template file), click on Event Triggers, and add that rule under the New Document event.

It's probably best that this rule be an external rule, just so you don't end up with tons of part files that all have variations of this rule in them.  And if you need to change something, you can do it in the one place, instead of a whole lot of places.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 7

peterjoachim
Enthusiast
Enthusiast

That's exactly what I'm looking for. But when I just tried that it's failing to complete the command. See screencast. Anymore ideas?

https://www.screencast.com/t/vx7K24uCqgIx 

0 Likes
Message 4 of 7

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @peterjoachim 

Executing asynchronously made the difference for me.

Try it like this instead:

ThisApplication.CommandManager.ControlDefinitions.Item("AppImportFileCmd").Execute2(False)

 

In the future, if you want to find the name of a controldefinition to execute this way, "AppImportFileCmd" for example, I've created a tool for this that you can run as an ilogic rule:

https://knowledge.autodesk.com/support/inventor/learn-explore/caas/simplecontent/content/ilogic-tool...

 

Message 5 of 7

WCrihfield
Mentor
Mentor

Nice tool!

I was using a few simpler rules.  One that writes out a somewhat detailed listing of each Command to a text file.  One that I can enter a string (keyword I'm looking for) and it loops through all control definitions to see if their DisplayName 'contained' my input string, and would return the single or list of command names that matched that criteria.  Among others.  But your rule works more like a simplified 'record macro' tool.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 6 of 7

JhoelForshav
Mentor
Mentor

Thank you @WCrihfield 

I actually used to just google it. The problem with that was that sometimes the command name i found had been replaced. So I wrote this to make sure i always get the correct and up-to-date name 🙂

Message 7 of 7

peterjoachim
Enthusiast
Enthusiast

That worked great. Also.. that is a sweet tool. Thanks.