Run rule after using save and replace

Run rule after using save and replace

JoãoASilva
Advocate Advocate
886 Views
4 Replies
Message 1 of 5

Run rule after using save and replace

JoãoASilva
Advocate
Advocate

Hello!

 

In our workflow, we create a part.ipt with a random name. When it is ready for 2d drawing and production, we use 'save and replace' to give it a Part Number.

 

When I run the 'save and replace' command, I need to run a rule to apply some custom properties based on the Part Number the user gives to Inventor.

I've tried with the 'Event Triggers' that Inventor offers, and the only one that works is 'After Open Document', but it hinders the processing of big files way to much...

 

There are 2 possible options I can take, and I would much prefer nº1 (simpler one):

  1. Using this solution and, somehow, adding my rule to run only after the 'save and replace' command is finnished (maybe a trigger?);
  2. Creating my version of 'save and replace', where I can pick (or have already picked), and go with renaming, SaveAs and replacing component;

The latter one gives more flexibility, but would mean a lot more effort in creating.

 

Does anyone have any clue?

João Silva

Mechanical Engineer

 

0 Likes
Accepted solutions (1)
887 Views
4 Replies
Replies (4)
Message 2 of 5

Curtis_Waguespack
Consultant
Consultant

Hi @JoãoASilva 

 

You can add a line to the end of your save and replace rule to run the other rule:

 

iLogicVb.RunRule(“MyNewRule”)

or 

iLogicVb.RunExternalRule("MyNewRule")

 

see think for mor information about the 'Run Other' rules:

https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-07DA57D0-B34C-49D8-8B44-5C554A07C359

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

EESignature

Message 3 of 5

Michael.Navara
Advisor
Advisor

I recommend you to use the second approach because you have much better control over the process and you avoid any side effect. 

Message 4 of 5

Curtis_Waguespack
Consultant
Consultant
Accepted solution

@JoãoASilva 

 

I originally read this as you already having your save and replace rule created, but were asking how to run another rule after that one ran. I understand now that you are wanting to recreate the save and replace functionality.

 

Here are a couple of examples I had on hand for this.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

EESignature

Message 5 of 5

JoãoASilva
Advocate
Advocate

@Michael.Navara , thank you for your input, that's exactly how I will proceed.

 

@Curtis_Waguespack , your save and replace file is just what I needed to get started with the pick functionality.

 

Thank you 🙌

João Silva

Mechanical Engineer