Not pulling updated properties until after save

Not pulling updated properties until after save

Chancellor.Kurre
Advocate Advocate
372 Views
5 Replies
Message 1 of 6

Not pulling updated properties until after save

Chancellor.Kurre
Advocate
Advocate

I have a dialog that opens on save and displays custom iProperties, allows edits, then saves these iProperties back to the file and continues on with the save. For initial save this works as expected. Hit save, dialog opens, function reads iProps, populated dialog with iProps. A save-as shows strange behavior though.

  • If the file is opened, iProperties modified, (not saved yet) then hit save-as, the iProps do not get pulled as the updated iProps.
  • If the file is opened, iProperties modified, file saved, then hit save-as, the iProps do get pulled in correct. 

This is what I'm using to pull the iProperties (PowerShell): 

$document.PropertySets.Item("User Defined Properties")

Using Inventor 2024.
 
Is anybody able to reproduce this behavior or have you seen it before?



0 Likes
Accepted solutions (1)
373 Views
5 Replies
Replies (5)
Message 2 of 6

AndrewHumiston
Advocate
Advocate

Good morning Chancellor!

 

I believe the problem you are running into has to do with the order the save/update/save back is happening. i know when working with ilogic (i know you are using PowerShell), sometimes the order of events gets out of whack. are you updating parameters? as that can have an unintended consequence of triggering and update in the middle of doing something else.

 

the other thought would be to isolate each level of code in modules then fire a variable that won't allow you to carry on to the next module until that variable is satisfied, that would at least test the theory of where the update is getting redirected.

 

i hope my rambling helps!

0 Likes
Message 3 of 6

Chancellor.Kurre
Advocate
Advocate

Hey Andrew, thanks for the response! I am not updating parameters, and the custom iProps that I'm updating are updated before the dialog opens. I would expect order and timing to be ok since it works fine on initial save, but it wouldn't be the first time things don't work as expected!

0 Likes
Message 4 of 6

AndrewHumiston
Advocate
Advocate
totally agree. i know i have a configurator, that has module rules in it, and for some reason it fires a rule prematurely, and it only does it 3/10 times and i have not found a way to isolate that rule despite some handling.

another thought would be to create a module for initial drawing implementation and then one for and update, and see if having the information trapped in a different code block might get you the results you'd like.
0 Likes
Message 5 of 6

Chancellor.Kurre
Advocate
Advocate
Accepted solution

To throw a wrench in the works, I'm using Data Standard to show the dialog and house the logic. I used your idea of a different code block and make a quick iLogic rule to pull the iProp and write it to a parameter using the same method I'm using in PowerShell. It worked as expected from the iLogic rule. Digging further, it looks like the document object I was pulling from was out of date. Getting the active document again before I pull the properties worked. Shame on me for thinking I'd have the up to date document object when the Data Standard dialog opened 😁 Thanks for the help Andrew!

0 Likes
Message 6 of 6

AndrewHumiston
Advocate
Advocate
Glad to help! Sounds like you figured it out.

getting and updated set of properties is an easy thing to miss!

best of luck to you!
0 Likes