Alternative to using Equations

Use this space to ask how to do whatever you're trying to use SolidWorks to do.
imaca101
Posts: 12
Joined: Wed Oct 25, 2023 10:06 pm
Answers: 0
x 8

Alternative to using Equations

Unread post by imaca101 »

I have a large part with sweeps representing cables.
I have 4 equations for critical dimensions used on all cables.
I have 60+ cables and I have hit major performance slow down.
This is due to having dimensions in the 3d sketch linked to equations.
If I edit 3d sketch with dimensions linked to equations it is incredibly slow with every click of the mouse resulting in a wait time of 30 seconds before the next click.
If I delete any dimensions linked to equation in the 3d sketch I am editing, performance is instantly restored to normal.
So the problem is that Solidworks equations seem to have a major bug that ruins performance once a file has more than a few 3d sketches.
Is there a better way?
User avatar
Glenn Schroeder
Posts: 1523
Joined: Mon Mar 08, 2021 11:43 am
Answers: 23
Location: southeast Texas
x 1761
x 2132

Re: Alternative to using Equations

Unread post by Glenn Schroeder »

I don't know how much these will help without better understanding what you're using the equations for, but two things may help. (I almost never use equations, but I know other workflows require their frequent use.)

1. Use global variables.

2. Use construction lines and relations whenever possible instead of equations.
"On the days when I keep my gratitude higher than my expectations, well, I have really good days."

Ray Wylie Hubbard in his song "Mother Blues"
Uncle_Hairball
Posts: 195
Joined: Fri Mar 19, 2021 12:21 pm
Answers: 2
x 37
x 95

Re: Alternative to using Equations

Unread post by Uncle_Hairball »

imaca101 wrote: Tue Mar 26, 2024 10:16 pm I have a large part with sweeps representing cables.
I have 4 equations for critical dimensions used on all cables.
I have 60+ cables and I have hit major performance slow down.
This is due to having dimensions in the 3d sketch linked to equations.
If I edit 3d sketch with dimensions linked to equations it is incredibly slow with every click of the mouse resulting in a wait time of 30 seconds before the next click.
If I delete any dimensions linked to equation in the 3d sketch I am editing, performance is instantly restored to normal.
So the problem is that Solidworks equations seem to have a major bug that ruins performance once a file has more than a few 3d sketches.
Is there a better way?
That's a great question and I wish I had the time to test a couple of ideas for you. If it's worth your time to try these out, I'd be interested in your findings.

1. Layout sketch; I'm not sure if this will accomplish what you're after. I've used it with very complicated assemblies in the past and had pretty good results. As I recall, the performance was tolerable, too, but your assembly might be more complicated than mine.

2. Linked equations text file. This is a pretty cool way to control a lot of variables and configurations. Again, I'm not sure about performance, but it may be worth a trial. I would recommend naming your equations file with something that specifically says, "DO NOT DELETE," as a lost file will wreak havoc.
User avatar
mp3-250
Posts: 633
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 708
x 348

Re: Alternative to using Equations

Unread post by mp3-250 »

Just to better understand: are your equations inside every single component or the top assembly alone?

we are using an In house made macro to design and manufacture piping for our machinery.
a 3d sketches for main routing lInes inside the assy and every component sweep references those sketches.
every component has a set of equations to back calculate length based on 3d volume and pipe diameter, and to workaround a bug with sensors we have other small equation here and there.
With some assembly we run In some strnge slow downs and I am trying to understand what causes them.
I am considering also very old templates as one of the reasons, as well as mates(but most are fixed components) , but the equations inside the components and the entities copied from the assy master sketch could be indeed a problem...
ryan-feeley
Posts: 82
Joined: Thu Jan 20, 2022 3:35 pm
Answers: 1
x 31
x 91

Re: Alternative to using Equations

Unread post by ryan-feeley »

You are correct that equations are an absolute boat anchor on solidworks performance. No idea why, but it is the case. This is not limited to 3D sketches, although it may be worse in that case. So to your question:
So the problem is that Solidworks equations seem to have a major bug that ruins performance once a file has more than a few 3d sketches.
Maybe. Solidworks equations have a major "bug" that ruins performance once the solver must process more than about 50 for a given model. The rough value of 50 may be even lower if equations are used in 3D sketches, rather than 2D, sketches.

If you aren't already on Solidworks 2022 or higher, try opening your models in such a version and see if that generates any circularity warnings. The newer versions got a little more naggy about highlighting situations where the solver is slowed down by equations. It will flag certain practices as "circular" which aren't from a mathematical perspective, but which do slow down the rebuilds none the less. Fixing these warnings isn't a magic bullet, but it can help a little.

As a rule, never use a driven dimension in the RHS of an equation. For some reason this adds an extra slow-down to the already slow equation processing.

Here are some alternatives:
  • Use equations, but disable them. With this workflow, you'd enable them anytime something changes, rebuild everything, and then disable them. Manually synchronizing everything is certainly error prone, but could work.
  • Use relations where ever you can. Perhaps you can have a few simple 2D or 3D sketches at the top of your tree(s) that define the relevant distances/lengths etc. Then your more complicated sketches that you might be editing more frequently can use equal-length relations to these. If you want an "equal-angle" sort of relation, you can build that manually using a few construction triangles and equal-length or equal-arc-length relations.
  • Live with the slow performance, but when you are editing such a slow sketch, toggle off the "automatic solve mode" (Tools -> Sketch Settings -> unselect Automatic Solve). You might want a macro button to put this ready at hand.
  • Use a macro to go from a text file, to sketch geometry. For example you could create sketches in the top of your tree as in the previous bullet, and use a macro to update their values.
  • Use a macro to go from text in sketch names, to sketch geometry. For example, you could name sketch "p1_x,1.23 p1_y,4.57 p2_x,98 p2_y1.0" and have a macro that processes sketch names, and if any match your magic syntax, they edit the sketches accordingly. This is more tedious than the previous bullet, but avoiding a sidecar .txt file could be easier to explain and maintain.
I've had trouble with linked equations files causing extra rebuilds, or causing files to always open dirty. They can be buggy with pack-and-go, as well. So I avoid that workflow entirely. If I need something similar, I use a master text file that I manually import key globals from, but do not link to. Any equation coming from that file is prefixed with "IMPORTED_". The first equation is a dummy that indicates the integer "version" and "release date" of the text file as a dimension <version>.<yyyymmdd>. This allows me to glance at the equations in the tree of a model and understand if they are up-to-date, or not.
First Equation is Version and Date.jpg
If you want to yell at your VAR, I could dig up a list of a bunch of SPRs indicating performance with equations sucks. I don't know that this would help anything though. This is "enhancement request" territory.
ryan-feeley
Posts: 82
Joined: Thu Jan 20, 2022 3:35 pm
Answers: 1
x 31
x 91

Re: Alternative to using Equations

Unread post by ryan-feeley »

Just stumbled across this on the knowledge base. This issue is marked "Implemented" in 2024. "Implemented" is not always synonymous with "fixed", but perhaps the situation is improved. @imaca101 , can you test with that version?
SPR on Equations with a Possibility that 2024 is Improved.jpg
I seem to find myself on the knowledge base quite frequently. Of all the softwares I've used in my life, including some dreadful stuff I've written myself, Solidworks stands alone in the breadth of knowledge of known defects it requires for my ordinary day-to-day usage. Not sure if the issue is Solidworks, or what I ask it to do, but it simply is.
User avatar
mp3-250
Posts: 633
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 708
x 348

Re: Alternative to using Equations

Unread post by mp3-250 »

ryan-feeley wrote: Fri Mar 29, 2024 7:27 pm Just stumbled across this on the knowledge base. This issue is marked "Implemented" in 2024. "Implemented" is not always synonymous with "fixed", but perhaps the situation is improved. @imaca101 , can you test with that version?

SPR on Equations with a Possibility that 2024 is Improved.jpg

I seem to find myself on the knowledge base quite frequently. Of all the softwares I've used in my life, including some dreadful stuff I've written myself, Solidworks stands alone in the breadth of knowledge of known defects it requires for my ordinary day-to-day usage. Not sure if the issue is Solidworks, or what I ask it to do, but it simply is.
Sometimes I find sort of amusing "technical comments" and dreadful "procedures" that should not exist in the first place or just not written in the help manual at all. like the correct procedure to export your drafting standards
ryan-feeley
Posts: 82
Joined: Thu Jan 20, 2022 3:35 pm
Answers: 1
x 31
x 91

Re: Alternative to using Equations

Unread post by ryan-feeley »

mp3-250 wrote: Fri Mar 29, 2024 8:37 pm Sometimes I find sort of amusing "technical comments" ...
Indeed! This is one of my favorites. If a 3D sketch doesn't solve (and mathematically it should), just add a random construction line somewhere. If that doesn't work, try somewhere else. This can actually work. And that it does is pretty scary. <()>
Add a construction line somewhere.png
User avatar
DavidWS
Posts: 23
Joined: Fri Jul 28, 2023 11:33 pm
Answers: 1
x 26
x 12

Re: Alternative to using Equations

Unread post by DavidWS »

I rarely use equations, as I find the equation manager interface frustrating... I do link dimensions offten, although. I do create some equations in the pop=up dimension dialogue occasionally, and name the important dims accordingly.

I just started working at a company that designs sound attenuating vessels... They have modelled their products almost completely using equations driven by external text files. I've found it very cumbersome making chages required.

Although their families of parts *can* be driven by equations, I am trying to steer them away from the purely equation driven method to a method of using a parent skeleton sketch to drive the models, which allows for the change of major dimensions driven by the skeleton model with associated parts updating via geometric relations.

It is a much more intuitive way of changing the model and also performance is much better.

Now, if I can get them to not create fill pattern perforated sheet metal parts, it will perform even quicker, especially the drawings with many section views and flat patterns of the perforated sheets!
imaca101
Posts: 12
Joined: Wed Oct 25, 2023 10:06 pm
Answers: 0
x 8

Re: Alternative to using Equations

Unread post by imaca101 »

Hi, just checked back in to this thread, just want to say a big thanks for all replies, some really good tips and info in there, thank you everyone
Post Reply