Circular References
I recently had a conversation with Alin Vargatu about external and circular references in SolidWorks. This discussion came up because we were talking about the order of calculations in assemblies. This is a chart Alin used at one of his presentations on the issue that shows the flow of operations after opening an assembly.
This is related to circular references because you can see there are a couple of loops in the flow chart, and the circular logic of self-referencing links will cause the SolidWorks routine to loop as well. Fortunately, this is just a simplified chart, and the full routine would have a checker for multiple loops. I think Alin said it will loop twice before shutting it down, and applying the rebuild symbol.
Catching an existing loop is of course important. I’m sure there are a lot of assemblies in existence that have this flaw already. In the past, it was easy to create circular references, and sometimes hard to detect them. But the symptoms of a circular reference were fairly easy to identify: long rebuild times and possibly a rebuild symbol on a part that never went away regardless of how hard you pound on Ctrl-Q.
I did some emergency tech support back in the 2003 time frame for a mold design company at one point where they had maybe 40 parts in the assembly, but it took a long time (more than 10 minutes) to open it because of all of the external references. There were over 100 Update Holders. So I sat down with the assembly and started to map out the references. Eventually, a part that had a “parent” arrow also had a “child” arrow. This of course means that they had “looped logic”. Changing Part 1 would start a cascade of changes that would eventually lead back to changing Part 1.
It was this kind of situation that lead to one of my initial recommendations for in-context type work: Always make relations that go “up the tree”. This was really inadequate because you could still move parts around and get confused between assembly and subassembly levels, but it was a start. Really, the skeleton sketch is what is needed for mold die work. The image below is not the tech support nightmare I ran into so long ago, but it is an example of skeleton sketches I use in my book. Notice there is a driving sketch for each of the X, Y and Z directions, so each of the plates, and the holes in the plates are controlled by three sketches at the assembly level.
Tooling like this is the most susceptible to circular or at least convoluted relations, and this is an easy place to demonstrate the skeleton technique to organize the driving links between parts.
SolidWorks has done various things to help users avoid stuff like this in the past, but most of it didn’t really work. There was the one product that mapped dependencies that I reviewed here, and it just didn’t work. Then there was a tool in the assembly RX, I think, that was supposed to identify circular references, but just didn’t.
But whatever they have in there now, actually works. I tried to make a circular reference with a simple two part assembly. Upon selecting a face of the first part to put a plane of the second part on, I got this message:
But, it turned out that this wasn’t a circular reference. This was a “conflicting context”. As long as we’re here we might as well talk about this one, because it’s another external reference problem that some people have to deal with.
Conflicting Context. Or Multiple Contexts. This was an option that was added to the software a long time ago, and I always tell the story that the option appeared after I had a conversation with someone at SW about a particular problem I had conjured where a part that was in-context in a sub assembly also needed to reference a part in the upper level assembly, but at the time this wasn’t possible, because the external references had to remember two different assemblies. So they added this switch. The switch is the cause of much of the evil in the world
today, I’m convinced. If single contexts are a thing to be feared by some, multiple contexts just open the gates of hell itself. This means that you can do the subassembly/main assembly thing, but also you can take an in-context part and put it in any assembly you want to put it in, and still make in-context relationships there. Which is a bad idea, just incase I still have to stress that.
The multiple contexts option is a system option, so if you get a part from someone else where they used it and created links in multiple contexts, the assembly will start getting errors on your system even though it showed none on the other system – the option is computer specific. It’s a dangerous setting in the hands of the over-enthusiastic and possibly inexperienced users. Just be careful about it. And don’t tell anyone its there if they don’t already know.
Ok, so back to circular references. In my never ending quest to break software, I was eventually able to force a circular relationship, but SolidWorks immediately broke the other link. And if you fixed that link, it would break the other link.
Interestingly, if you hit Ctrl-Q, the error would disappear. And then if you opened up the feature to edit it (without actually editing it), and then closed it, the error flag would return (dangling error).
So, it looks like SolidWorks has two different defenses against circular relations. One is the error that pops up when you make one, and the second is that it will not go into an infinite loop if you pull up an old you created before these defenses were in place. Still, you need to be aware of looping logic, and avoid it if you can with some sort of “system” that we have been talking about in the last several posts.