Repeating Sketches of Different Sizes

Hello friends,
I would like to draw an airplane propeller and for that I was going to start from a profile (sketch) that I would repeat on different planes at different angles and sizes.
Do you have a link or the outline to get to that?

Hello and welcome;

In another context, I will recommend configurations and families of parts (see also the use of Configuration publisher) but aircraft propellers are complex to model so adding configurable dimensioning to them will depend a lot on your level in 3D modeling.

1 Like

Thank you Maclane,
I'll check it out.
I'm not a beginner (SolidWorks 2006) and not an expert either.
For the moment, I have my Naca profile configurable by equations, the different planes of section at a certain distance from the axis of rotation of the propeller.
In a program I calculate all the dimensions of the profiles and their angle that I save in a text file for the SDW equations.
To avoid copying the base profile on each plane and adding equations for each point, I hoped to be able to make reduced copies of my base profile according to position and angle. All profiles are images of the base but smaller and differently oriented.

If you already have all the dimensions to vary as well as the angles of the planes to be modified, the most practical is the Room Family (Configurations) controlled by an Excel table.

1 Like

OK great I'll look into that.

Arf or misunderstood but it's not about pieces here but profiles.

Hello
Yes, but you make the profiles in a file (part). Inside, you create a family of parts inside which you create only a profile but can be configured in an excel format. your equation will have all the comfort of an Excel page.

Hello again
Personally I've already drawn some and I was off as follows:
I make in a 3D sketch a believe in the 3 directions on which I place points.
These points are used as a support to repeat shots in a point-driven (usually vertical) repetition. On the Horizontal plane, I control the profile and position of the points with your equation.
To answer your question, don't have to repeat the same sketch multiple times.
There are several ways:
The projection of the previous sketch
The derivative sketch
The block you reinsert as needed

These are the dimensions you'll be driving with the part family, so it will work great with one (or more) sketch(es).

1 Like

Hello @Benoît_Bouillon,

A macro will do the trick...
Everything is in the attached zip file:

  • Solidworks 2022 model of my example
  • text files of the Eppler387 profile
  • Macro code
  • Word file of the user manual

image

Modified macro, to be downloaded below, message 12...

3 Likes

Holà thank you.
m_blt, thank you for your file, the explanations in addition, I have nothing more to do then :slight_smile:
I'm going to try to understand and apply all this.

Always wait for the counter-order after the order...

Some bug fixes in the version below, and the addition of two [Save] and [Open] buttons that allow you to save and replay a set of data.
SW 2022: Eppler387.zip (698.9 KB)

With two uses of the macro, we will soon be able to compete with our Yankee friends in terms of stealth aircraft...
image

2 Likes

Thank you m_blt.
In a few words, could you explain the link between the different points of the profiles and your macro?
How did you copy each profile on the different plans?

Good evening,

Each sketch is based on two splines, one for the upper surface of the profile, the other for the lower surface.
In both cases, the origin point is the leading edge of the profile, and the x-coordinate varies from 0.0 to 1.0, i.e. a chord of the profile equal to 1.0. A scale factor must be applied to both coordinates to adjust the profile to the desired chord dimension.

In the macro, all sections use the same profile with its two splines, in parallel planes:

  • Distanced from the datum plane of the Position/Z parameter value.
  • The coordinates are adapted to take into account the desired offset of the profile following Position/X and Position/Y (denoted decX and decY in the code),
  • of its inclination (Angle) around Z,
  • and the scale factor.

For a point M with coordinates (XM, YM) in the profile coordinate system, the coordinates are (Xg, Yg) in the general coordinate system of the sketch.
I assumed that the profile first underwent rotation around its leading edge, then the decX and decY offsets along the axes of the profile coordinate system. Hence the relationships:
Xg = ((decX + XM * scale) * Cos(angle) - (decY + YM * scale) * Sin(angle)) / 1000#
Yg = ((decX + XM * scale) * Sin(angle) + (decY + YM * scale) * Cos(angle)) / 1000#

Below is a video to illustrate how to use the macro.

1 Like

Great, thank you!
If I understood correctly, you're starting from a blank page with the 3D sketch1?
So if I start from your file I delete the smoothing, the planes and the sketches but when I do that the 3D1 sketch disappears too.

Hello,

On the example provided in the zip, the Esquisse3D1 was built " by hand " after running the macro, to allow me to validate some properties of the geometry.
On the example of the video, I built it before running the macro: these are three segments parallel to the axes of the Solidworks general coordinate system.

But it is quite possible to start from a completely empty model.

There are in the zip all the documents to make the blade of my example:

  • Extrados and Lower Profile Files (*.txt, for an Eppler and for a NACA)
  • data files (*.dat, again for both profiles)
  • The macro code (*.swp)

Just follow the steps in the video.

I was asking you this because the program crashes after creating the foreground so I was hoping it's because the 3D1 sketch was missing even if it doesn't seem to intervene in the macro.
I don't have an error message for the file path, it creates the foreground and then bam, it crashes.

Hello,

If your version of Solidworks is indeed 2006, as stated in one of your first posts, I'm not surprised that the macro doesn't work... Typo?

I created the macro with the SW 2022 environment. If your version is older, some of the functions used in the code may not exist...

What is your version of Solidworks?

Immediately after the plan is created, the sketch is drawn and the profile files are first played. If they are not found, a warning message should be displayed.
If this message does not appear, the files exist. There may then be a read error if the data format is incorrect. No checks are made during playback, but in this case, VBA should send an error message.
Beyond that, the parameters of the section are read in the table. Again, there is a risk of error if the values are not numeric.

What files do you use? Those I have provided you, or of your own creation?
If it's a personal version, send me the files (.txt) of your profile and the backup (.dat) of your data.

To identify the problem precisely, the solution is to run the macro in debug mode from the VBA macro editor. When an error occurs, execution is stopped and the line of code in error is highlighted.

Are you able to use the VBA macro editing environment?
If so, on which line does the error occur?

It's hard to go any further without knowing more details about your project and your attempts to execute the macro...

Arf as often in programming, it's a stupidity that is responsible for the crash.
I guess you have a different Windows locale than mine, decimal " ." and I had " , ".
By changing that, the profiles appeared :slight_smile: Thank you again a thousand times for this great job and learning a new field for me.

Our messages must have been written at the same time because I hadn't seen your response yet.
As said in the previous message, it was a decimal problem.
I'm using the 2026 version now, I chose other Naca profiles and it works perfectly.
Maclane and Fred, I'm going to look at your methods as I've never encountered them before.
Thank you.