Scaling body through equations

Use this space to ask how to do whatever you're trying to use SolidWorks to do.
User avatar
mihkov
Posts: 51
Joined: Sun Feb 05, 2023 2:01 am
Answers: 0
x 20
x 25

Scaling body through equations

Unread post by mihkov »

Most likely the question has already been asked, but I couldn't find it. Is it possible to scale a body or surface without entering the scaling factor manually, but by calculating it with an equation?
Well, the same question about Blocks in sketches.
scale.jpg
scale.jpg (9.31 KiB) Viewed 431 times
User avatar
DanPihlaja
Posts: 870
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 818
x 998

Re: Scaling body through equations

Unread post by DanPihlaja »

I don't think so (although some other enterprising person may be able to figure it out).

I thought that it was going to be similar to a pattern, in which you create the pattern, and then double click the pattern in the tree and select the numbers on screen. Or go into equations and select them there to include them in equations.

But it isn't. Once you create a scale, the scale factor doesn't seem to show up anywhere.
I even tried to configure the scale, and select it that way, but you can't.
In fact, you don't think that you can even configure the scale at all.
I tried to add a config, then change the scale in the new config, then switch back. But the scale stays through the config changes.

Google searching, everyone seems to think that you can add an "=" and then a letter and it will automatically create a global variable. But I can't get that to work at all.

So my answer is only with a design table (see below) (as of SW 2022 SP4)

And then, it is still messy.

https://r1132100503382-eu1-3dswym.3dexp ... 9MXKKrnEJQ
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
mihkov
Posts: 51
Joined: Sun Feb 05, 2023 2:01 am
Answers: 0
x 20
x 25

Re: Scaling body through equations

Unread post by mihkov »

DanPihlaja wrote: Tue Jan 07, 2025 10:28 am So my answer is only with a design table (see below) (as of SW 2022 SP4)
Thank you for not suggesting to write a macro)))


A specific example. Let's get gears, or even better a wing profile - a wing profile is just such a poorly parameterized surface. It is easier for an engineer to take points and make a smooth outline. Or it can be a milling cutter profile...
Let's say you built a wing profile by points, made a smooth outline with a spline, got a closed profile with a chord length = 1 mm (or 1000 mm for greater accuracy). You can create a block from this sketch and import this block into the working model, where you draw the airplane. You have already accurately selected the profile, but you are still calculating the wing size. And your wing area and the chord size change, and you did all this with equations, and your wing has a sweep (the profile at the beginning and end has a different Scale). And this scale is calculated in the Design Sketch and essentially you get the lengths of the lines at the root of the wing and at the edge. And now you want this very Block with the wing profile to be scaled according to the length of these lines from the sketch in order to build the wing by sections. How to do this in Solidworks? Or something similar: The point is that there is an imported contour or surface or body and you need to manage their scale.
Attachments
NACA0012.SLDPRT
(37.55 KiB) Downloaded 30 times
User avatar
Dwight
Posts: 279
Joined: Thu Mar 18, 2021 7:02 am
Answers: 2
x 2
x 220

Re: Scaling body through equations

Unread post by Dwight »

I assume you do this by tying everything to one dimension in the model, then you adjust the scale by adjusting that dimension. For convenience, you can create the model with that dimension equal to 1.

Dwight
gristle
Posts: 26
Joined: Wed Apr 07, 2021 5:17 pm
Answers: 0
Location: New Zealand
x 21
x 24
Contact:

Re: Scaling body through equations

Unread post by gristle »

mihkov wrote: Tue Jan 07, 2025 10:47 am Thank you for not suggesting to write a macro)))


A specific example. Let's get gears, or even better a wing profile - a wing profile is just such a poorly parameterized surface. It is easier for an engineer to take points and make a smooth outline. Or it can be a milling cutter profile...
Let's say you built a wing profile by points, made a smooth outline with a spline, got a closed profile with a chord length = 1 mm (or 1000 mm for greater accuracy). You can create a block from this sketch and import this block into the working model, where you draw the airplane. You have already accurately selected the profile, but you are still calculating the wing size. And your wing area and the chord size change, and you did all this with equations, and your wing has a sweep (the profile at the beginning and end has a different Scale). And this scale is calculated in the Design Sketch and essentially you get the lengths of the lines at the root of the wing and at the edge. And now you want this very Block with the wing profile to be scaled according to the length of these lines from the sketch in order to build the wing by sections. How to do this in Solidworks? Or something similar: The point is that there is an imported contour or surface or body and you need to manage their scale.

I've recently been through that exercise. I was modelling a rowing outrigger and the client supplied an aero section to use. I ended up having to manually rescale the sections when tweaking the chord lengths of the outrigger. I have figured out a work around though, the following two videos cover it.




Why Dassault still has not exposed scale (as of sw2025) to variables is beyond me....
Cheers, Andrew Jackson.
Petertha
Posts: 42
Joined: Sun May 26, 2024 3:34 am
Answers: 0
x 11

Re: Scaling body through equations

Unread post by Petertha »

Specific to airfoils, I went through some of these issues in a different life, at that time using Rhino. Of note

Not all published, or by association, 'generated' airfoils are of equal quality. Some are downright rough because that's what they had back in the day. You can see this using surface evaluation tools like Zebra stripes. Some catalogs or databases have 'cleaned up' versions of many of the classics. My advice is to evaluate the resultant XY intercept splines at the section level. You might be able to improve, but of course potentially entering territory of modifying the airfoil itself where it begins to behave differently. This also becomes important when it comes to blended airfoils across a wing. You may have to artificially insert or modify consistent control points that SW can utilize. Generally speaking the best resolution focus should be the first third of airfoil but its just a guideline.

Many airfoils (but not all) have the classic 0,0 leading edge & 100,0 trailing edge based coordinate system. (Getting in the weeds here but many airfoils do not start at 0,0 or end at 100,0). Anyways I mention this because one workflow is to scale the section & position it at various outboard wing stations, apply wash in/out (twist) etc. The downside is the TE is now essentially a line. That in itself may be useful for intermediate designing, but in real life you typically want a constant thickness trailing edge of some defined dimension for manufacturing reasons. Say the thickness of aluminum or composites molds etc. But the trim amount will vary as a % of chord depending on its physical length. It may lop off 3% of the longer root and 5% of the shorter tip. Kind of user preference, but another workflow is to deal with the TE at the section level, then position, then loft. I oscillated back & forth depending on the application.
User avatar
mihkov
Posts: 51
Joined: Sun Feb 05, 2023 2:01 am
Answers: 0
x 20
x 25

Re: Scaling body through equations

Unread post by mihkov »

Petertha wrote: Thu Jan 09, 2025 10:51 am Specific to airfoils, I went through some of these issues in a different life, at that time using Rhino. Of note
This is an interesting experiment, but not on topic. The airfoils is given only as an example.
User avatar
mihkov
Posts: 51
Joined: Sun Feb 05, 2023 2:01 am
Answers: 0
x 20
x 25

Re: Scaling body through equations

Unread post by mihkov »

gristle wrote: Tue Jan 07, 2025 3:24 pm I've recently been through that exercise. I was modelling a rowing outrigger and the client supplied an aero section to use. I ended up having to manually rescale the sections when tweaking the chord lengths of the outrigger. I have figured out a work around though, the following two videos cover it.
Why Dassault still has not exposed scale (as of sw2025) to variables is beyond me....
Excellent option. It's bad that there are many additional constructions. Perhaps you should think about transferring the profile chord value to a separate file and returning the scaled profile from there.
And your option will not work well if we suddenly change the profile.
This is the best at the moment.
I think this might even anger the DS developer who commented out the use of Scaling in equations in the SolidWorks code.
User avatar
mihkov
Posts: 51
Joined: Sun Feb 05, 2023 2:01 am
Answers: 0
x 20
x 25

Re: Scaling body through equations

Unread post by mihkov »

Dwight wrote: Tue Jan 07, 2025 2:49 pm For convenience, you can create the model with that dimension equal to 1.
I don't understand you. Could you explain it a little more fully using the wing profile as an example?
User avatar
mihkov
Posts: 51
Joined: Sun Feb 05, 2023 2:01 am
Answers: 0
x 20
x 25

Re: Scaling body through equations

Unread post by mihkov »

gristle wrote: Tue Jan 07, 2025 3:24 pm I have figured out a work around though, the following two videos cover it.
A few improvements to the gristle variant (I think)
1. Create an auxiliary model for each profile that we want to use.
2. In the model, create a boss by sections: From the original profile with a chord of 1000 mm to one reduced by 10 times (100 mm) at a distance of 1000 mm. (Here we decide that we will not use a profile with a chord size less than 100 mm and more than 1000 mm, if we do, we expand the range).
3. Also create a line dividing the profile by the chord, and scale it according to the coordinate system so that the chords of both profiles lie in the plane above (see the NACA2412 and NACA0012 files)
NACA0012.png
4. Create a Wing part, for example, with a complex contour in which one profile passes into another.
Wing.png
5. Add our auxiliary parts with profiles to the part with the wing and place them on the start and end lines of the section with the profile, according to the size of the line.
6. Create a plane on each line of the beginning of the end of the section with a sketch of the intersection with the corresponding profile body (here we get the profile contours with the required scale (by line size)
7. Create a boss by sections for Section naca2412 and naca0012. And also a boss by sections between them for a smooth connection.
scale11.gif
* We do not consider the applicability of this wing for real world use!
Attachments
Wing.SLDPRT
(524.29 KiB) Downloaded 4 times
NACA2412.SLDPRT
(114.69 KiB) Downloaded 4 times
NACA0012.SLDPRT
(96.05 KiB) Downloaded 4 times
gristle
Posts: 26
Joined: Wed Apr 07, 2021 5:17 pm
Answers: 0
Location: New Zealand
x 21
x 24
Contact:

Re: Scaling body through equations

Unread post by gristle »

mihkov wrote: Thu Jan 09, 2025 12:25 pm Excellent option. It's bad that there are many additional constructions. Perhaps you should think about transferring the profile chord value to a separate file and returning the scaled profile from there.
And your option will not work well if we suddenly change the profile.
This is the best at the moment.
I think this might even anger the DS developer who commented out the use of Scaling in equations in the SolidWorks code.
Yes, extra construction, but that is the name of the game when working with SW work-arounds!
They must have a reason why scale has not been opened up to equations... I wonder why.
Also reference points (both length and parameter) cannot be controlled.
Cheers, Andrew Jackson.
Craig Schultz
Posts: 33
Joined: Fri Mar 19, 2021 10:04 am
Answers: 0
x 8
x 24

Re: Scaling body through equations

Unread post by Craig Schultz »

mihkov wrote: Tue Jan 07, 2025 10:09 am Most likely the question has already been asked, but I couldn't find it. Is it possible to scale a body or surface without entering the scaling factor manually, but by calculating it with an equation?
Well, the same question about Blocks in sketches.

scale.jpg
Simple answer: Yes. Set the scaling up as global variables and then have a feature at the end of your design tree for scaling. And then you have one configuration for the actual part, and one configuration for the mold.

I did it at my previous job for thermoformed plastic. Think auto part dunnage for factory use. There was a certain scale factor for X, one for Y, one for Z. I proved it out so that the legacy peeps wouldn't have to manually type it in on the drawings and the initial model maker wouldn't have to scale it on his own. It went over like a lead balloon, hence, one of the reasons it's a previous workplace.
User avatar
DanPihlaja
Posts: 870
Joined: Thu Mar 11, 2021 9:33 am
Answers: 25
Location: Traverse City, MI
x 818
x 998

Re: Scaling body through equations

Unread post by DanPihlaja »

Craig Schultz wrote: Fri Jan 10, 2025 7:25 am Simple answer: Yes. Set the scaling up as global variables and then have a feature at the end of your design tree for scaling. And then you have one configuration for the actual part, and one configuration for the mold.

I did it at my previous job for thermoformed plastic. Think auto part dunnage for factory use. There was a certain scale factor for X, one for Y, one for Z. I proved it out so that the legacy peeps wouldn't have to manually type it in on the drawings and the initial model maker wouldn't have to scale it on his own. It went over like a lead balloon, hence, one of the reasons it's a previous workplace.
So, can you show me how assign a global variable to the scale factor without a design table? Because in my experimentation, I couldn't figure it out.
-Dan Pihlaja
Solidworks 2022 SP4

2 Corinthians 13:14
User avatar
SPerman
Posts: 2097
Joined: Wed Mar 17, 2021 4:24 pm
Answers: 14
x 2282
x 1921
Contact:

Re: Scaling body through equations

Unread post by SPerman »

This option appears for me in 2024 SP5. (It doesn't appear on feature creation, but it does when I edit the scale feature.)

But you're right. I still can't point it to an equation.
image.png
-
I may not have gone where I intended to go, but I think I have ended up where I needed to be. -Douglas Adams
User avatar
mihkov
Posts: 51
Joined: Sun Feb 05, 2023 2:01 am
Answers: 0
x 20
x 25

Re: Scaling body through equations

Unread post by mihkov »

Craig Schultz wrote: Fri Jan 10, 2025 7:25 am Simple answer: Yes. Set the scaling up as global variables and then have a feature at the end of your design tree for scaling.
Access via dimension does not work.
"Scale1" = 1.22
"D1@Scale1"=1.22
sc3.png
sc3.png (16.75 KiB) Viewed 83 times
Access via configuration parameters does not work.
sc4.png
sc4.png (9.86 KiB) Viewed 83 times
Access via design table works.
"$X_AXIS@Scale1"
sc5.png
It is not possible to get the properties configured by the user.
sc6.png
Craig Schultz
Posts: 33
Joined: Fri Mar 19, 2021 10:04 am
Answers: 0
x 8
x 24

Re: Scaling body through equations

Unread post by Craig Schultz »

I remember now that scaling and moving/copy bodies can't be driven by equations (only the awesome people at DS know why this still isn't available....along with patterning other reference geometry o[ ) I was thinking about how I accomplished doing this through a PDM template.

Essentially I had it set up through PDM to have the actual part inserted into the wood pattern part number that had the scale feature. Our scale factor stayed the same across products (but different in the X vs Y vs Z). So I set it up to copy tree the main part and the scaled part number along with their drawings. Then the notes were populated with the envelope/overall dimensions, and the STEP file was created when released.

So I misremembered how I accomplished it, but overall this was the cleanest and least amount of typing/figuring to get to the end product. It was a heck of a lot easier/faster than what was happening. Literally scaling every part, hoping nobody finger fumbled, praying they didn't send out the wrong configuration STEP file for tooling, and no figuring out the dimensions by finger fumbling the scale factor or the drawing note.
Post Reply