Hi There,
I like to keep the properties of my drawing the same as those of my model. Currently I must remember to hit the "updat copied properties" button in the drawing to discard any old drawing properties and replace them with the properties from the model.
Is there any way to automate this task (perhaps on saving the drawing?) I presume an iLogic rule could be created in the drawing template, just not sure how to go about it.
Thanks
Solved! Go to Solution.
Solved by alessandro.gasso. Go to Solution.
Here’s an iLogic rule that will do it.
Dim oControlDef as ControlDefinition = ThisApplication.CommandManager.ControlDefinitions.Item("UpdateCopiedModeliPropertiesCmd")
oControlDef.Execute
For this rule, you have to uncheck the Silent Operation option on the Options tab in the rule editor if you want to see the prompt "This command will overwrite...".
You could set the rule to run on the After Open Document and/or Before Save Document events (using Manage -> iLogic -> Event Triggers).
I hope it helps.
Kind regards,
Alessandro
This works great! Thank you!
I've added this rule to our drawing template and have also set the rule to run silently (kept the silent operation option checked) to get rid of the nagging prompt. This keeps the part iProperties and drawing iProperties synced.
Alessandro,
Regarding silent operation. I am running your iLogic rule as specified, however I don't want the pop-up window that says: "This command will overwrite specified drawing iProperty values with the model's value. Do you want to continue?", so I have silent operation checked.
I thought running the command with silent operation selected would prevent this pop-up; however it does not. I've input the rule into our drawing templates and I don't want everyone to be pestered by this window. I realize I can chose to hide that prompt by selecting "Do not show this message again ever", but....
I thought silent operation meant silent operation.
-Jeff
Hi Jeff,
As you can see from the attached video, it works for me.
If you want, you can share your template with me.
Thanks and regards,
Alessandro
Yeah, it looks like it works great for you. I wonder what I'm doing differently.
I have the rule triggering only "Before Save Document" due to everytime I open the drawing, it would show as a change had been made. This would make it impossible to change the state from Inventor.
I also have selected, "don't run automatically" when parameters change.
I've attached the drawing and part template. These are in progress... and I'm definitely open to any suggestions you may have. Thanks for the video!
Thanks for reporting the problem.
There was a little issue in the original rule that if you run it manually, the Silent operation option is respected, but, if the rule is started by the trigger, the option is disregarded and you get the prompt.
This is the difference between my video and what you are doing.
Please, replace the original rule with the one below, provided by Mike Deck and everything should work as expected.
Dim oControlDef as ControlDefinition = ThisApplication.CommandManager.ControlDefinitions.Item("UpdateCopiedModeliPropertiesCmd")
oControlDef.Execute2(True)
Kind regards,
Alessandro
That fixed it! Thank you.
Does this iLogic work in 2017? I have tried this script a couple of times and I have not gotten it to automatically populate the iproperties. Am I missing some thing?
I also added both versions of this rule to my drawings and ran it. Absolutely nothing happened. I copied the rules verbatim. Was there some edit I was supposed to have made? Does this rule serve the same purpose as automatically pushing the Update All Sheets button (which is what I want) or does it only update certain properties in the drawings?
Hi. I do realize this forum was started in 2011. But I tried implementing the iLogic rule in 2020. But for some reason, I get the error stating: Type 'ControlDefinition' is not defiend. Do you know if this iLogic rule is compatible with Inventor 2020?
Hi Pieter,
It should work. I tried the same code on 2020 and I did not get an error. I think maybe you have multiple model references. Inventor can get confused by which one to push the iProperties from. Could you share an example exhibiting the behavior here?
Many thanks!
I am now finding this iLogic rule does not work in Version 2022. Absolutely nothing happens
This ilogic rule below is just activating the "UpdateCopiedModeliProperties" button in the drawing ribbon.
Dim oControlDef as ControlDefinition = ThisApplication.CommandManager.ControlDefinitions.Item("UpdateCopiedModeliPropertiesCmd")
oControlDef.Execute2(True)
It sounds like the copy model properties check boxes (what to copy from model to drawing) haven't been selected. Can you check that?
All of the buttons I want to copy are checked. Basically I have to do it manually now.
I did have it set with a trigger to update before saving. It just fails to work at the moment
Are you getting any error message? Can you add a message box into the rule to ensure it is firing when you save?
Here is the message box added
Dim oControlDef as ControlDefinition = ThisApplication.CommandManager.ControlDefinitions.Item("UpdateCopiedModeliPropertiesCmd")
oControlDef.Execute2(True)
MessageBox.Show("The copy iproperties rule has run")