- [Educator] SolidWorks has some powerful tools
for working with equations and linked variables.
And we can easily access that toolbar if I turn it on.
So, right over here, if I click on the very top icon here,
on our part, right-click on it,
and come down here to Tree, or Hidden Tree Items.
And below that, you'll see Hide/Show Tree Items.
Click in there, and right over here, you can see equations.
And right now it's automatic.
So, that means if you start using equations,
that will show up.
But I want to just show it all the time.
So, just show all the time, click on Okay,
and now you can see we've got equations right over here.
Okay, so let's go ahead and manage the equations.
That's going to pull up this box right here.
And we have several different types of equations.
We have global variables, we have features,
and we have just basic equations.
So, right in here,
I'm going to type in something like just the letter A.
So, here's my first equation A, and then hit Tab,
and then what I want that to equal to.
So, I'm going to say five inches, okay?
Hit Tab again, it's going to bring it in there,
and then you can create another variable.
So, let's time let's call B.
So, let's think you have big B, Tab it over.
We'll say three, Tab again.
And that's all we need to start with.
So, if we created a couple of global variables.
Now when we go back to our sketch,
we're going to tie in and use these global variables
to drive our sketch.
So, click on, Okay,
let's go ahead and fire up a sketch.
So, I'm going to choose sketch right over here.
Let's go ahead and use the front plane
and let's just draw a really basic corner rectangle.
Starting at the origin click there,
drag out a rectangle.
Now traditionally you would grab
the smart dimensioning tool.
Come over here, grab like a line
and then go ahead and type in like 2.0, all right.
And that's how you would define this shape.
However, we want this to be control by an equation.
So, instead of actually just typing
in the value right over here,
I can hit the equals key on my keyboard
and they'll bring up this little list
to choose from global variables,
functions or even file properties.
But right now we want to use global variables
and notice right over here are those two global variables
that we've already created.
So, I'm going to, is the B variable here,
say that's equal to that, click Okay.
And notice that this icon is now changed.
So, you can see the little Sigma in front of there.
So, it's showing us
that that variable is controlling that dimension.
So, if you want to go back and change the global variable
this sketch will automatically adjust.
Same thing over here.
Let's create one more smart dimension.
From this side over to this side over here,
go ahead and place the dimension.
But instead of actually typing in a value,
again hit equals on your keyboard,
come down to the global variables and choose A,
click on Okay.
And now you can see that one also changes.
So, it's showing that it's controlled by a global variable.
Let's go ahead and extrude this out.
And I'm going to type in just one inch for right now.
Okay?
So, there's our block.
Now, if we want to go back and change our global variables,
here's our equations, right?
Manage equations.
Let's go ahead and change them,
let's say this is going to be eight by,
something else it's like eight by five, right?
So, we're going to change those, click Okay.
Go back to our part and it automatically adjust to the size.
Let's go back and take a look at that sketch.
Here's my sketch,
and now it's eight by five
because it's been driven by those variables.
This is also great if you're making like a hole
and you want to make a half inch hole all over your part.
So, every time you create a hole
you just link it to that global variable.
Then as your design progresses, if you decide, hey
I would like change from a half inch hole
to maybe a one inch hole,
go and change that one global variable
and every single hole in your part will automatically adjust
because they're all linked to that variable.
A couple other things.
Right over here under the extrude, right?
I can come over here and say edit feature.
And instead of actually typing a value over here
I can also do the same thing.
I can link that to a global variable, right?
So, I've only got these two global variables
in here right now.
Let's choose B, and click Okay.
And now that is also controlled by that global variable.
Let's go try and create one more sketch.
Right over here, I'm going to say this sketch here,
and I'm going to create just another simple rectangle.
All right?
And now what I want to do is I want to create a dimension.
So, I'm going to say, hey,
this dimension or this length right up here,
that dimension I would like it to be equal
to a global variable.
But however, I don't have a global variable
that I actually like,
so I can create one right here.
So, I can say this is equal to, and we'll call it R.
And if I click on something like an R,
it gives me some little popup global,
well, like a little earth looking thing here.
And I can say, hey, I want that R to be a global variable.
And then I want that to be equal
to whatever value I type in here.
So, it's five inches, and then click on Okay.
Now on the fly, I was able to create that global variable.
And notice over here,
if you actually kind of hover over it,
it says D one at sketch two,
that's what's being driven by that global variable, okay?
And then over here, we can do something even cooler.
So, instead of actually creating a global variable
I can say, this is equal to this length
and I'm going to click on it right here.
So, I'm going to click on the dimension,
that dimension, divided by two.
So, I can actually create an equation right in here,
click on Okay,
and now that's always going to be half
of what this dimension is over here
and you can do even more.
So, over here, you can make another dimension, right?
This time,
I'm going to say this guy is equal to this dimension over here
click on it, divided by, and then two and click Okay.
All right,
so now we created several different linked variables
or global variables.
So, let me show you how those all work.
Let's go ahead and create another feature.
Let's do an extrude, as far as what I want to let link to.
I can say also global variable
or I can create a function, something like that.
I can do a bunch of other cool things here
but let's go ahead and link this back over
to that R variable, click Okay, and there it is.
And if I go ahead, take a look at the equations,
you can see we've got those three different variables there.
And if I go over here and manage the equations,
you can see I've got the three global variables
but then I also have these linked variables over here.
So, I'm linking and using this information down here
that's bringing that information back
and using these variables up here,
as well as creating some equation is to define the shape.
And you can do all kinds
of really cool things with these equations.
We can create very complex formulas.
We can do trigonometry.
We can pull properties from the parts themselves.
So, it's really great way
to leverage the power of SolidWorks
to create some very intricate designs
that are completely controlled
by equations you in SolidWorks.