Dirty Files and what causes them.

Hi All!

I don’t suppose I’ve ever really delved too deep into this topic, but as the size of my assemblies is increasing it becomes an essential consideration.

In the past I often noticed that even when you open a file that has just been saved on reopening it there will instantly be that little asterisk next to the file name and SW will want to save it and along with it the entire dependency chain.

As I alluded with smaller assemblies and drawings, where rebuilds and saves take fractions of seconds it’s no biggy but now my rebuild/ save times are getting up into minutes and I do not have the time to sit watching SW rebuilding and saving files that I know 100% are up to date.

This morning I noticed my top level assembly had developed this annoying trait, so I decided to diagnose the cause.

My System Options External References are

  • Open Referenced Documents With Read Only Access
  • Don’t Prompt To Save Read Only Files(discard changes)
  • Load Referenced Documents: Prompt

I opened up my components one by one to see where the root cause lay.

The first one has two configs with an inserted part that is configured to match.
All of my parts have a rebuild save mark for every config, so the parts contain full data sets with every save.

When I open the part I am presented with these options
When I select

  • Don’t open any referenced parts - all is good.
  • Open any documents that have changed - all is good ( because nothing has changed)
  • Open All referenced documents - I get the asterisk.

This is despite no changes and the readonly setting set… and heres the kicker and why I think this is possibly a bug.

If I already have the referenced part open there is no problem.

So why should merely opening a referenced part cause the file to be flagged dirty?

What do you think?

Do you know any other causes / workflows to avoid this problem?

you are using the famous “PRT in PRT” aka “Ext. Ref.” in SW
that feature can make running SW very slowly.

if you only need to add “removing volumic feature”,
you can consider the “ASM, with PRT inside, and feature to remove volumic”

another thing, if you want to work with the “Ext. Ref.”
is to know to use it more efficiently.

are you needing a “Dynamic Ext. Ref.” or not ?
at the beinning of using it for PRT, it’s dynamic.
but in many cases, after the worked done, turn it into the “Static Ext. Ref.” is enough.

i saw you work with the “Read Only” workflow.
So you may understand the benefit of “Static Ext. Ref.”

to set it, right-click on the top of PRT with Ext. Ref. inside, go to the Ext. Ref. menu,
and choose “Lock”,
So SW will stop trying to calculate-evaluate it.

and if you need to update it for a change, simply unlock it, do the change, relock it after.

I’ve jumped to the conclusion that it’s an issue caused by outdated templates but I’ve no idea what causes it to be honest. If you ever do figure it out though, I’d like to know.

Cheers Merovingien

Yes, I lock them when I can, but this one needs to update.

One problem I have found is that when unlocking references - it causes errors in the parts

Rob,
Can you post your part? Also, get an AE from your VAR involved. The more eyes looking at this the better. This is something to identify and it’s very possible it is a bug.

I think I have run into this before, but I’m not sure I ever dived in and sorted it out.

I had an ASM a while back that would actually throw an ! error. It was one I created before I knew as much as I know now and had A LOT of components in the ASM. I now know to break it into sub assemblies for exactly this type of problem…Unfortunately, I don’t remember what I did to fix that one.

Rob,

Thinking out loud here, but could you have a cross-reference, or a file with the same name in 2 differing locations?

Example: First assembly would load file with reference A. Top asssembly would load file reference A2. So when you open with no referenced parts, all would good.
If you ask it to open any document that have changed, all is still good. because nothing has changed.
If you ask it to open all referened documents, File A2 loads first, overriding the reference into the first assembly, causing the first assembly to require a save or rebuild.

Hi Matt :slight_smile:

I am using some custom features from my Add-In, so uploading these files isn’t going to be much use. If I can’t solve it I and I have time I might prepare a simplified assembly using only native features.

I have been in contact with my VAR but honestly, the help is hardly ever worth the time investment. Most times contacting my VAR is for catharsis, when I want a solution ‘the forum’ is the best place.

The irony is I have simplified my assembly structure and created new simpler subs. I did this by creating copies of my original components and deleted some features - and this may have been the step that introduced this problem, because I’m 99% certain it was working better before.

Hi Alex :slight_smile:

Could be.

My project folder was getting a bit messy, so I packed and go’d to a zip file - then moved all my dev work to a new directory.
And then extracted new versions of just the files I was actively working on back to my project folder.

I was concerned SW might still look at the old files (not quite ready to delete them) - but they are in a brand new directory that SW has never seen?

SW shouldn’t be able to find it then in general.

You could do a quick check by going to file­>view reference and then copying that list to an excel file and viewing if the reference of the file that you speak of, lies somewhere else inside that list.

Yes! If you are doing anything with Pack 'n Sometimes Go, always check the references because those files sometimes don’t go. I like to add a prefix like “v1-”, to prevent this scenario and to easily be able to see that the files are correctly referenced in the ASMs from the feature tree. Another thing you can do is zip the original folder and delete it to prevent SW from referencing the old location.

If you don’t like the v1- at the beginning for your finished product, you can always use PnG again and “Select/Replace” to remove that text and create a new version.

I did find that constant traffic light is because of circular ref.
Happen when I add a part to the ref master assembly and re-ref that to the master sketch.
The re-ref may not be intentional.
While editing Master Sketch in assembly, SW could and will pick anything to ref. It is very easy to pick wrong part.

I just finished a project with some heavy external references. In my view external references are better than in-context assembly references. Don’t criticize stuff just out of habit.

I did recently have one part that went to 1.8 GIGAb. 1 part. This part did have some wacky complex geometry, and a lot of fussy detail.

SW adds a lot of external data including parasolid data for bodies in various states of rollback. So rolling back and using multiple bodies I think really compounds things (which I do extensively). Plus, if you have configurations, that really really compounds things (I don’t use configurations, in general). And it also stores information about file locations, so if you move your parts around a lot or reference them from different locations, it’s storing information about that as well. There are properties of features, and info about when it was edited…

Some of this is just text data, but the parasolid stuff can get really big, and any time you have even text data repeated again and again for hundreds of features, it can get out of hand.

This is part of the reason I try to avoid unnecessary complications in assemblies, including configurations (as long as I can’t avoid it, and then always using a table when I can’t avoid configs), display states, in-context, virtual, and things like that. There’s no need to push your luck with assemblies just to see how many cool things you can add.

I think this happens in parts with external references and in assemblies. SW stores a lot of junk data inside the files. I thought there was a purge tool at some point. Memory starting to fail me…

Sometimes data just gets left behind and is never purged, and can just build up.

As for the “dirty bit” I know for a fact that it is just there sometimes, and this has been the case for more than a decade. When I worked at a reseller I’d submit parts whenever I could, but I don’t think they ever figured it out. You can fix things sometimes by deleting features. You don’t have to have a circular reference.

And losing references to edges or things like that? That’s where I spend probably 80% of my modeling time. With surfacing you have to reference edges, and all it takes is the tiniest shift and normals flip, directions change, selected become deselected (trim feature). If you want to get real work done, just accept that the tool is flawed deep down inside somewhere, and it has emotional problems we can’t fix. Just deal with it.

The big problem I’ve been having recently is when you use Convert Edges (maybe including when you select a face to convert all edges around face) in combination with regular sketched elements and then sketch trim something. Very often after an unrelated change the trim gets undone, and you’ve got a wacky hot mess on your hands.

Ahhh, just venting. Had a frustrating last couple of months with this stuff.

Yo Flaw

I started out with external refs from my skeleton (reffing global variables in equations to control component suppression and spacing) but this created a nightmare for rebuilding, so I spent the weekend stripping out all the external refs and I automated the updates by api, one file at a time. This cured the rebuild issue, but I still have the save issue.

The only thing the skeltons do at assembly level now is provide faces to mate to.

I tend to agree with matt that sometimes SW files accumulate artefacts that cannot be purged.
Maybe a saveas could help?

It’s too bad we don’t have more folks from “the old days” here. We went through a lot of these issues and had some sort of fix for them. I think SolidMuse Anna Wood helped figure out a lot of this stuff. We were doing things like turning the part/assembly to wireframe, pushing the geometry off the screen before saving, making the window as small as possible, extruding a box around the part as the last feature, etc…

But then SW outsmarted us by taking a standard iso image of the model as a thumbnail preview.

I can’t remember all this stuff on my own. Anna, are you there? How about mirisj Jeff M? Surely mbiasotti would remember some of this?

I don’t use assembly ref.
The Master is the only one ref a Master Assembly to get ref from customer part and purchased parts.
All modeled part ONLY ref Master “Sketch”.
Usually mate is not needed since every part is modeled in place from the Master.
When mate is required, Master is put into the assembly and part mate to Master.
Completely avoid mate between parts. Unless necessary.

Rob,

Save-as indeed does a major purge of leftovers. There might be some things left over though. I’ve seen file be 4 times smaller after a save as

This should be the first thing taught to anyone using SW.

I had this with a part that had multiple configurations and each had MBD GDT and dimensions. Just opening the part would flag it. I removed all MBD content and rebuilt all configurations, then inserted it into another part and its fine now. You can open the part that contains the inserted part and nothing flags as dirty. 2021sp2

To an extent I agree. When it’s a “how to” or has more to do with modeling than with SolidWorks, or best practice, or … or… or…

But there are some tools that users just don’t have. Plus, and I gotta say this out of love, guys, some time users believe the stupidest stuff.

The one big advantage that VARs have is that they can contact SW directly. I agree that a lot of VARs just play goalie with user issues - anything to keep from allowing you to fool them into actually writing something up as something other than PEBCAK. But, for certain things, actually a lot of stuff, you have to guide them to providing you with the right answer.

I’ve done a lot of tech support, and I’ve been on the customer side of a lot of tech support. I know users get shoved off a lot, or at least feel that way. But I also know that most user problems are self-inflicted, and if I took the time to troubleshoot every self-inflicted SW wound from users, there wouldn’t be any time for real support.

Anyway, why isn’t Alin here defending himself?

If Alin were my VAR, I would have a completely different opinion.

My communication typically goes like this:

ME: “I’m having this problem”

VAR: “Soldiworks doesn’t handle that very well.”

ME: “Have you reported this to Solidworks?”

VAR: https://media.giphy.com/media/uLy4Bo680hZxm/giphy.gif