Dirty Files and what causes them.

Use this space to ask how to do whatever you're trying to use SolidWorks to do.
ryan-feeley
Posts: 82
Joined: Thu Jan 20, 2022 3:35 pm
Answers: 1
x 31
x 91

Re: Dirty Files and what causes them.

Unread post by ryan-feeley »

I've got three more to add to this list. One is just a "facepalm". The other two are a little more insidious.
  1. Your "History Options" registry setting is lower than when the model was last saved. It defaults to 10. But if your system has a lower value than the file was created with, the model will always be dirty on open as the stored history gets truncated. This option is not exposed in the Systems Options GUI, but you can access it by right-clicking the history folder when you have a model open. This one took me a lot of registry diffs to track down.
  2. You are using equations with "driven" dimensions on the right-hand side (RHS). While this is perfectly legit in terms of math and feature tree history, something about the internals of solidworks doesn't like this. It can trigger multiple rebuilds, circular reference warnings in some versions, inactive configurations losing the green checkmark, etc. Most of the time you can get creative with relations or "up to vertex" types of conditions to avoid using driven dimensions like this.
  3. You have equation expressions that evaluate to different values for different configurations (perhaps because the RHS uses a configured variable). I've posted about this before: in Part with two sketches -- switching configs causes the inactive to be out-of-date This will cause configurations to lose the green checkmark when you switch configs. Defeating the "rebuild all" approach to managing this dirty-files issue.
Here is a little more detail on #2. Maybe someone here knows what is going on internally.

Prior to Swx2021, the software allowed the RHS of an equation to depend on a driven dimension without complaint. Then various service packs for 2021 started throwing errors or circular reference warnings. In theory they are spurious warnings, since there should be nothing circular going on, but when you did this in older versions, there was often a performance hit. Solidworks sort of discusses this in S-064386: Why might ‘Potential circular reference’ warnings display in the equation dialog box? They say programmatically the solver isn't as smart as you are, so does stuff like rebuild multiple times, etc. You can notice this in particular in sketcher environment where you might see a particularly laggy sketch that uses this workflow with equations. You can sketch faster by turning off "Automatic Solve", but that's only a bandaid.

On the 3ds knowledge base one finds articles like these:

Why is a user prompted with an error message when a driven dimension is chosen in an equation? QA0000010622]
Since driven dimensions do not actually control the equation, the error message is warning that using a driven dimension will lead to multiple rebuilds when making changes to a part or assembly file. SOLIDWORKS™ does not prevent the user from choosing driven dimensions for equations, but it is not recommended.
In the ‘Equations’ dialog box, why does the 'Automatic solve order' option inactive? QA00000121117
[Some text omitted]

This is an enhanced behavior in SOLIDWORKS 2021 in order to avoid circular references which is caused due to Reference dimension (driven dimension) used for "value / Equation" for global variable or equation.For more clarification on this please refer the sample file,
  • Open part “Part 2.sldprt” in SOLIDWORKS 2021.
  • Go to Equations > Notice “Automatic solve order” is Greyed-Out.
  • Delete "D1@Sketch2" from equation and add value. The expression will become "A = 55 / 2".
  • Notice the option 'Automatic Solve order' is available.
  • This happened because of driven dimension "D1@Sketch2". SOLIDWORKS recommends you to avoid use the reference dimension to create global variable and equations.
User avatar
AlexLachance
Posts: 2189
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2374
x 2015

Re: Dirty Files and what causes them.

Unread post by AlexLachance »

ryan-feeley wrote: Tue Jul 18, 2023 3:51 pm In the ‘Equations’ dialog box, why does the 'Automatic solve order' option inactive? QA00000121117
Very easy to answer, most likely it impaired a little or a lot on performance and that was added to then say "Look our program is faster then ever" while omitting that they've removed some of it's automation to speed it up.
User avatar
CarrieIves
Posts: 163
Joined: Fri Mar 19, 2021 11:19 am
Answers: 2
Location: Richardson, TX
x 377
x 136

Re: Dirty Files and what causes them.

Unread post by CarrieIves »

This is a late reply, but it was something we ran into. We use PDM Standard. We were having trouble with files being shown as modified right as we would open them. Or files used in assemblies would show modified. It was files with configurations. We had at add a display data mark to each configuration. This solved most of our problems.

We did have one file that was convinced it was modified every time you opened it until we did a save as, and then it was fine. We did a save as to outside of PDM, then did a save as to make it a new version in PDM.
User avatar
mp3-250
Posts: 630
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 704
x 347

Re: Dirty Files and what causes them.

Unread post by mp3-250 »

Found something related in the KB
Question
What are the steps to troubleshoot a drawing that takes a long time to open?

Answer
When a drawing takes long time to open, this can indicate that the associated assembly requires rebuild. In cases where the drawing contains section views, this also triggers recreation of the section views. Therefore, you must also wait for the assembly to rebuild and potentially for the section views to recalculate.

To ensure that the assembly updates correctly and that it does not require rebuild:

Open the assembly and view the top of the SOLIDWORKS® window to determine if a dirty symbol flag (*) appears after the assembly name.
In this is the case, rebuild and then save the assembly.
Open the assembly again and determine if the * symbol still appears. If so:
Go to the task pane, File Explorer and expand the Open in SOLIDWORKS folder.

All the assembly components that are responsible for the dirty symbol problem appears in the Open in SOLIDWORKS folders with bold characters. These are the files that force SOLIDWORKS to rebuild the assembly every time you open a drawing.

You must investigate every problematic assembly component to determine why you cannot rebuild or update the component.
Keywords S-061221,1-1FXXIKC
ryan-feeley
Posts: 82
Joined: Thu Jan 20, 2022 3:35 pm
Answers: 1
x 31
x 91

Re: Dirty Files and what causes them.

Unread post by ryan-feeley »

Dwight wrote: Fri Jan 21, 2022 7:13 am I find any model file with more than one configuration is automatically dirty whatever I do.
Dwight
[UPDATE thanks to Rob! Prior to 2020, if an assembly uses a model in a configuration that is not the "last saved configuration", which automatically includes any case where an assembly uses two configurations, the model will be marked dirty, because Solidworks pro-actively recalculates the display list data (graphics). See #2 in Alin's video: Inefficient use of Configuration Data by Older Versions of SOLIDWORKS: 38:25​. In a related note, there is a system assembly option to "Update model graphics when saving files", that you probably want to enable, so if you edit a model incontext of an assy, the model's updated graphics will be saved along with the updated geometry.]

Are you using equations in any of these files? I've fought with dirty files over the years, but I am generally able to use multiple configurations and not have a file be dirty. When external references are involved, it gets more tedious, but can still be made to work. The only case it can't is if the parent model has more/different configurations than does the child.

I just avoid having more than one configuration in any parent model. If I need an incontext assembly relation, and my "real assembly" needs multiple configurations, I'll make a separate dedicated assy that just handles getting the incontext relation passed into the child model.

Sometimes a file does get "weird" though. In that case, I find that I can fix it with this procedure. It may effectively do the same thing as @CarrieIves save-as trick.
  • Roll the tree back to the origin
  • Doing CTRL+SHIFT+Q
  • Close and reopening Solidworks
  • Roll the tree to the end
  • Do another CTRL+SHIFT+Q
  • Manual activate each configuration and make sure the previous active one doesn't loose the "up-to-date" checkmark. If it does, try manually activating each configuration and doing a separate CTRL+Q in each.
User avatar
Rob
Posts: 128
Joined: Mon Mar 08, 2021 3:46 pm
Answers: 2
Location: Mighty Glossop, UK
x 787
x 208
Contact:

Re: Dirty Files and what causes them.

Unread post by Rob »

hi ryan

did you see alins post? In versions prior to 2020 displaying multiple configs in an assembly will cause the file to be dirty.
Adding a save on rebuild mark will ensure every config is rebuilt on save.
For files with external references make you sure to follow the best practise as shown in the help
https://help.solidworks.com/2020/englis ... Redirect=1
ryan-feeley
Posts: 82
Joined: Thu Jan 20, 2022 3:35 pm
Answers: 1
x 31
x 91

Re: Dirty Files and what causes them.

Unread post by ryan-feeley »

Rob wrote: Sun Nov 12, 2023 11:10 am did you see alins post? In versions prior to 2020 displaying multiple configs in an assembly will cause the file to be dirty.
Adding a save on rebuild mark will ensure every config is rebuilt on save.
Thanks Rob! I appear to have missed that (at least in this viewing of this thread -- I've watch the video start to finish, perhaps on your recommendation). Makes sense, and may explain why I've been much happier with 2020 (which I'm still on) than I was with 2019. I'll update my post so I don't confusing anyone.
Post Reply