Fully-Parametric Equation

In the attached photo, i want to define a relationship between a and b. I want to say that the sum of these two values (a & b) should be constant and equal to 150.

But i don’t know how I should formulate it with the equations' syntax of SolidWorks.

Is it possible by equations or i need to step into the realm of macros?

SolidworksApi/macros
Answers 29
DL
DL 2021-04-09 Best Answer

b = 150 - a

Or am misunderstanding what you're trying to achieve?

PV
PV 2021-04-09

As I showed you, it is possible to do with a very simple set up in equations but the issue is that you want it to all to be calculated instantly without a need of a rebuild. This, as Josh Brady explained eloquently explained, is just not feasible.

With a macro it might be possible to give the appearance as if there's no rebuild needed but the question is why bother to make a macro like that in the first place.

In other words, why is it vital that it needs to be with an equation or a macro?

The elegant solution offered by Rob Edwards in his first post is for what reason not good enough?

MP
MP 2021-04-09

Rob, even i made the excel formulas and software to directly reach to focal points. no problem with the Geometric aspect of problem. my problem is not about solving the Geometric problem. i need the Technic to express and solve it with equations or macros.

MP
MP 2021-04-09

wow! thanks for clear message. as usual i learned so much. this is what i love about this forum. to get the clear descriptions about what is going on in your mind. thanks for your time and clear context.  

MP
MP 2021-04-09

the same strategy you did with the relations should be done with the equations and macros. what you say about ellipse is right. but my point is this that such a logic should be exertable via equations and macros. but when we have no access to equations and macros your smart solution is completely right and is the last resort. or the solution which used the path dimension is also right and gives the right answer. or the solution which calculates the points and drawn shape via analytic Geometry is right too!! but my point is this: making such relations between the dimensions should be appliable with equations or at least macros!! and i want to find that track!

JB
JB 2021-04-09

Meysam Agazadeh Par wrote:

yep! that's right. i know that and i even made the geometric calculations to find the relations of radius's and focal points. but the original solution should be done via equations or macros. it should be done automatically NOT with my calculations.

You can only use relations.  Rob's first post is best. You cannot set up equations that will allow you to drag the length of one line and automatically reduce the other at the same time.  It just doesn't work that way.  Equations evaulate during rebuild.  

You also cannot do that with macros.  I mean, it's technically possible, but would be completely impractical and would involve significant effort by someone who is very knowledgeable about writing macros already.  As a new user, it would take several years of learning SolidWorks and macros before you were at that point.  

RE
RE 2021-04-09

Please could you explain exactly how you would like it to work.

I'm not sure I understand the solution you require.

MP
MP 2021-04-09

yep! that's right. i know that and i even made the geometric calculations to find the relations of radius's and focal points. but the original solution should be done via equations or macros. it should be done automatically NOT with my calculations.

RE
RE 2021-04-09
RE
RE 2021-04-09

Hi Meysam

Your problem is describing an ellipse, so another solution could be...

Here using two sketches

Note my Path Length is driven - just to show it works

comment imagecomment imagecomment imagecomment imagecomment imagecomment image
DL
DL 2021-04-09

Looks like it was introduced in 2014.  No chance of upgrading your software version?

MP
MP 2021-04-09

yes i did. it needs either a or b to be known. but i want both to be floating and the aggregate to be constant.

PV
PV 2021-04-09

It isn't stuck with a constant value.

Have you tried yourself to see if having 'a' being set equal to a 'driven' dimension works for you or not?

MP
MP 2021-04-09

i don't have path dimension in SW 2011 !!

MP
MP 2021-04-09

woow !!

would you please give me some information about "Path Dimension"? where can i set it? i've not seen such thing before!

MP
MP 2021-04-09

no actually it should not need any adjustment !! it should be dynamic and interactive not stuck in a constant value. that is what i am looking for...

PV
PV 2021-04-09

Another way would be to have 'a' to be equal to the driven dimension of that side

Then you can calculate b=150-a

or

to make the dimension of side b being equal to 150- 'dimension of a'.

The latter needing rebuild after each adjustment of 'a'

comment imagecomment imagecomment imagecomment image
DL
DL 2021-04-09

If you want to simplify Rob's even further, you can use a Path Dimension on the two segments.

comment imagecomment image
FL
FL 2021-04-09

Good for you.

MP
MP 2021-04-09

yeah i know what you mean. but this trick really works !!

FL
FL 2021-04-09

He did.

SW will go crazy if you use that sketch for anything.

You can't solve 2 variables with one equation.

MP
MP 2021-04-09

look at what Rob did! actually he solved it without knowing them.

i really got thrilled with what he did.

but i still need to exert the same logic with equations. 

FL
FL 2021-04-09

You cannot have 2 unknown.

You need to define either a or b.

MP
MP 2021-04-09

omg !!

You did a subtle job Rob !!

Greaaaat!

i enjoyed it !!

thanks for sharing !!

but how can i do this with equations?

DE
DE 2021-04-09

so basically: a + b = 150

RE
RE 2021-04-09

Hi Meysam

How about this?

comment imagecomment image
MP
MP 2021-04-09

i don't want to reach a specified and defined triangle with constant sides! it's easy to do so. actually i want a make a dynamic equilibrium between the measures. i want to make SW exert and keep the equation while dragging the lines. just like the differential equations which do not have a number as an answer! the answer is itself an equation.

FÖ
FÖ 2021-04-09

To achieve this, there should at least one rule for the triangle, like a degree.

MP
MP 2021-04-09

i did it but this is not what i mean. it needs one of them to be determined. i want both the values to be floating.