Built cabinet in Model State.
Top, Bottom, Post and Rail.
All are MS for different Width, Height and Depth.
No reference between the parts. No Master Skeleton, no linked parameter, no derive, no adaptive.
Top, Bottom, Rail keep getting dirty even all are Released in Vault.
All files are updated from old designs, IV2011 is earliest in this assembly.
I've check them out and save a few times and they still getting dirty.
IV is 2023.2.1 Vault is 2023.2.
We also have this problem with modelstates! It seems there is a general problem... It makes me cracy...
Good, I'm not dreaming 😴
Would be nice to be able to see why the file is dirty.
CAD and PLM admin | My ideas | Inventor-Vault Expert GPT (my AI brain)
@Frederick_Law wrote:Would be nice to be able to see why the file is dirty.
Does the new "Save State" information give any useful clues?
I'll check that when it popup again.
Checked everything in. Get and overwrite local. So far not dirty yet.
Hi Frederick,
The only logical reason I can come up with is that the file dirtying event is due to the fact that the Model State member docs in the lower level component files were not elaborated.
The way Model State works is that after the Model States are authored, the Model State mini files (member docs) are not yet created. You may activate each Model State to see how it looks like. However, the Model State mini files will be created when a Model State is consumed in an assembly or an a drawing. Such consumption will dirty the component files.
Many thanks!
So we need to activate each MS in each assembly to those "mini" files?
Even if only iProperties were changed in the MS ipt?
I usually finish model in MS, setup all the assemblies then go back to add Part Number and Description to the table.
Just a guess here, but, depending on what your "Physical Properties" options look like in the "General" App options tab, could it be due to physical properties for any of the components in those sub-assemblies not being up-to-date?
I would assume that each MS calculates its own set of properties, so maybe one or more hadn't had a chance to do so before you checked in and keeps trying when you open them?
Physical is all updated.
That's first thing I checked because I have iLogic to get Mass.
I was watching iLogic log yesterday making sure the rule won't dirty the file if mass didn't change.
Just update everything, IV 2023.3, Vault 2023.2.1. Let see if it happen again.
Update.
Modeled a new Model State part. Setup 2 Model State assemblies with hardware: part -> assm1 -> assm2.
Both assm won't dirty the one below it.
All 3 are saved and checked in.
When I open another assembly (no Model State) that use assm2 (SidePanel-Assy-MS.iam), all 3 get dirty after MS is changed in assm2.
After the files are saved and check in, activate another MS which was not activated in this assembly before will cause the dirtying again.
If MS is changed back to what it was, save is not required.
I try activate all the MS and one got popup asking to check out the files.
And the save state changed:
After activate EACH MS in assm2 (SidePanel-Assy-MS.iam) and save after EACH change, it doesn't happen again.
After reading your post, it makes me wonder exactly how Model States (MS) deal with physical properties. I would guess that they're stored separately for each existing MS in a file, but it seems like Inventor doesn't actually calculate them all when you save the file (possibly just the active one at the time). This might be by-design.
If that's the case, then when you switch to a different MS in an assembly, it has to calculate the properties for that state that were missed before, then saves those values to the part file and which dirty it (and all assemblies it's in).
That makes me wonder if you could reduce or eliminate the issue by either:
If you have a minute to do so, maybe you could create another new MS part and try one those methods to see if it does anything to prevent constant dirtying of MS files?
1: Save after EACH MS activated
2: Placing each instance should prevent dirtying. Only the MS file with [Primary] will get dirty, tested in other assembly.
I activate other MS in the same assembly and they all dirty lower level MS.
There are 4 things in Save State: User Edits, Implicit Update, Mass Property Update, Model State Updates
All of the dirty has Model State Updates.
Lower level MS had all mass updated in each MS so they don't need update.
I've iLogic to save Mass to custom iProperty so I don't show LBMASS 🤣
I've iLogic log out and show if Mass is different.
So I don't think Mass Property should/did change for lower level MS.
Also if MS change back to one that was used, dirty get removed. Save won't include those files.
Solution fir now: activate each MS and save.
Gonna need an Addin.
Actually I should check if MS file size increase after each save.
3 MS files:
Side Panel-MS.ipt
Side Panel-MS.iam
Side Panel-MS-Assy.iam
Side Panel-MS-Assy.iam insert into another assembly.
Then all 3 files get dirty. Not just Side Panel-MS-Assy.iam
Hi Frederick and Chris,
The physical properties are computed on the fly when you are authoring or activating each member. But they will persist when the given Model State is consumed by an assembly or a drawing. Internally, we call the process of consuming a Model State, "elaboration." It is kind of like creating an iPart member file. The difference is that the member file is stored within the factory as opposed to a separate ipt file on disk.
Regarding the dirtying three files case, if possible, please share the files here or send them in zip to me directly johnson.shiue@autodesk.com. Assuming all members are elaborated, there should not be a need to dirty all components. It does not make sense to me. I need to take a closer look.
Many thanks!
I believe it behave how you descripted.
Every time a new model state is consumed, it save the elaboration.
ie a new iPart is created and need save.
We need a way to elaborate all MS before we consume them.
Like iPart "generate all files".
The dirtying is not much problem in non-Vault environment.
In Vault, all MS should "elaborate" when Released or even Check-in.
So future consumption will not dirty the file.
At this moment I can't "elaborate" in the MS file.
I need to put it in an assembly, activate each MS and save each time.
Activate all MS and save will only save the last one.
iLogic code to activate each ModelState and save:
'Program assumed only one part/assembly is in the assumbly
'Files should be Checked Out if in Vault
'
'Start new assembly, save it. Insert ModelState part or assembly
'Copy rule to assembly and run
Dim oDoc As AssemblyDocument = ThisDoc.Document
Logger.Info(oDoc.DisplayName)
Dim oCompDef As AssemblyComponentDefinition
oCompDef = oDoc.ComponentDefinition
'Get Component with ModelState, assume only one
'Change to for-each to get on all components
Dim oOccu As ComponentOccurrence
oOccu = oCompDef.Occurrences(1)
' Get native document ComponentDefinition of occurrence.
Dim oOccuDef As ComponentDefinition
oOccuDef = oOccu.Definition
'Get ModelStates collection object.
Dim oModelStates As ModelStates
oModelStates = oOccuDef.ModelStates
' Activate all model state from ModelStsates object
' If ModelState file get dirty after activate, save all files
Dim oModelState As ModelState
For Each oModelState In oModelStates
oOccu.ActiveModelState = oModelState.Name
If oModelState.Document.Dirty Then
Logger.Info("Changed " & oModelState.Name)
oDoc.Save2
End If
Next
Run in Log Level:Info to see which MS need update in iLogic Log.
This will make a mess of files that have Model State files that are Vaulted. Sounds like we will be constantly checking In / Out.
Hopefully they get this sorted out soon.
Can't find what you're looking for? Ask the community or share your knowledge.