7 Replies Latest reply on Sep 12, 2018 6:47 AM by Marcos Rodríguez

# Purposely Inserting an Iterative (Circular Reference) Equation in the Equation Manager

Hey All,

I am producing a profile shifted Helical gear, and yes I want the exact model geometry so that I can have a non gear shop machine it without using a gear cutter.

Anyway, the formulas use the "Involute Function" and the "Inverse Involute Function"  The later uses an iterative method to churn through the equations until the changing result is small enough so that you don't care.  When I try this in Solidworks equation manager, it gives me the circular reference message.  Great that is what I want.  I tried to stop the loop with an "IIF" statement to break out when a specified number is reached, but no luck.

Am I on the right track with the "IIF" statement?  Or is there just a button I can use to turn on iterative equations and limit the loops the equation manager will calculate?  They have this sort of thing for NX, but I am using Soliworks now, and we're not entirely friends as of yet.

• ###### Re: Purposely Inserting an Iterative (Circular Reference) Equation in the Equation Manager

And now the follow up.

If there is no way to do iterative equations In the equation manager in a slick manner, I would be interested in knowing the maximum number of global variables I can use?

• ###### Re: Purposely Inserting an Iterative (Circular Reference) Equation in the Equation Manager

Have you tried the equation driven curve?  There are also several quite good threads on here regarding gear modeling using the involute equation driven curve.

• ###### Re: Purposely Inserting an Iterative (Circular Reference) Equation in the Equation Manager

Yeah, I actually have a couple of parametric equation driven curves to produce the involute curves in the model.  I'm not aware of how to use one to figure out the inverse involute function, but I will check out the equation driven curve discussion to see if there is a way, besides I have other issues with the equation driven curve anyway.  Maybe I can figure out how to make 1 equation driven curve, then mirror it and have it maintain its parametric features when revisiting the sketch.

• ###### Re: Purposely Inserting an Iterative (Circular Reference) Equation in the Equation Manager

It is very interesting if you can get away with making "illegal" equations. This way you can create some very interesting constructions.

In similar cases, I have uses Excel to do the math including iterations.

To transfer the results to SW I use one of two options.

• Populate a design-table with your results (requires relative few dimensions in well defined sketches)
• Make a separate Excel sheet containing X-Y-Z coordinates, save this as a txt-file and import this as a "Curve through XYZ points" (more steps and difficulty maintaining relations - faster and easier for curves with a lot of control points)

Be aware; depending on your language settings you might have an issue with decimal "." vs. decimal ",".

• ###### Re: Purposely Inserting an Iterative (Circular Reference) Equation in the Equation Manager

Thanks, I will try the population of a design table from an excel file, and see how that goes.

• ###### Re: Purposely Inserting an Iterative (Circular Reference) Equation in the Equation Manager

OK probably not the real way to do it, but all I need is around 100 iterations, so I created 100 separate equations, each one builds off the one before it, then I use the 100th equation in my other calculations.  Yes Solidworks wants to choke on it, not sure why it is only 100 equations, but anyway to combat this I would recommend using a dummy variable for all of the iterative calculations to begin with while modeling the geometry, then enter the iterative equations which isn't that bad with cntrl-c and cntrl-v, then switch out the dummy variable for the calculated one and wait a little while as Solidworks is force fed the equation protocol.  Like I said, it choked on it for a while, but in the end, I was the winner, and the desired results were achieved.

Time for a beer.

• ###### Re: Purposely Inserting an Iterative (Circular Reference) Equation in the Equation Manager

hi Robert,

i've created a couple of macros that could help you to get some inspiration:

This creates an involute equation curve.

this ones uses the IIF() in the equations panels to take decisions.

let me know if you need more clarifications.

Regards.