Hello
I want to create a sketch repeat by varying some parameters. For example, repetition of hole sketches by varying the Ø of them. Unfortunately, it is not possible to vary the occurrences of a sketch. Even on a function, I can change the spacing increment but I can't find anything if I want an increment concerning the Ø of the hole.
Thank you in advance if anyone can help me...
PS: Basically, I would like to make a sketch like on the diagram above.
Hello;
I don't know which version of Solidworks you are using, but normally it is possible to use " Variable Repeat " to get this type of results:
Kind regards
Hello;
On the official Solidworks forum, you can see the answer proposed to @john_john by Andreas SPIELER for practically the same request:
…
Hello @john_john ,
The joined macro allows a repetition of a sketch of a circle with a regular increase in its radius. And only a circle, although other entities could be considered.
The only instructions for use are in the video below.
There are few securities, so you have to be vigilant about the order in which entities are entered.
And no Ctrl^Z in case of clumsiness...
RepeatIncrmt.swp (83.5 KB)
Hello and thank you for the info. Unfortunately this does not solve my problem.
To be more explicit, here is the file that is causing me problems. I laid down each sketch manually, the angles and lengths evolving according to equations.
I would like to automate this principle so that I only have to draw the 1st sketch and make a circular repetition by varying the year D1 and the length D2.
Rack Generation.SLDPRT (2.5 MB)
Hello;
What is the Solidworks version of your file?
(A priori it's higher than 2022)...
Have you tried the Variable repetition with an Excel import to keep your equations?
I think you have to abandon the idea of doing your repetitions in a sketch and make them from a function (material removal?).
Well I can't open your file but I protest ...
You want to:
and the Variable repetition meets this demand perfectly.
(you can vary the diameters as well as the angles (distance) of each occurrence, all in a circular repetition...) I must have misunderstood your question.
Actually, Super macro @m_blt . (And yes, Macro and CTRL+Z are not super compatible.)
This is the 2024 version.
Indeed, I have to do it with a function and not a sketch.
Going through SW, I can't put formulas to vary the angles and lengths. By creating an excel file that calculates all this, it should work.
Thanks for the advice.
Good evening
Apparently, it's about generating the teeth of a pinion from a rack. This is a far cry from the circular repetition of circles with increments of the radius...
If I have understood correctly, the goal is to implant the rack in successive machining positions, by making sure that its primitive line rolls without sliding on the primitive circle of the future pinion.
The rack is defined as a sketch block. Interest:
- a single entity, easy to implement in a sketch by a VBA function,
- the same function allows you to define the position of the insertion point and the inclination of the block (no need for dimensioning, unless you want to constrain all the sketches),
- it is sufficient to exploit the condition of RsG as a function of inclination to define the coordinates of the insertion point. In the initial position, the insertion point is placed at the tangent point of the primitives.
Then the function of removing material in a loop remains to be repeated: about one second per position.
The parameters to be defined are as follows:
- the primitive radius of the pinion by selecting the primitive circle,
- the numerical value of the increment of the angle of inclination,
- the number of positions to be generated.
It works, revealing some interference at the tooth foot of the pinion. A gear offset is necessary...
generationRackwarming.SLDPRT (1.1 MB)
[edit] Modified GenerationCr.swp macro (91.5 KB), downloadable in the following message...
Hello
Thank you for the answer, it's super interesting.
I have a question (VBA functions are a bit of Chinese for me). Where is the block used to do the various material removals? When I delete everything to keep only the sketch in which the primitive circle is located, the macro will look for block 6 but I don't know where.
I would like to be able to draw the rack in a block, and then generate the different positions of it to see the profile obtained.
For the interferences, I agree but not necessarily annoying, my goal being to find the right rack profile, in order to obtain the desired involute starting point and to " dig" enough at the foot of the tooth.
Hello
A priori, a block can be used, in insertion, modification, saving as a file, as long as it is present in a sketch.
If all sketches where it is inserted are deleted, it is no longer accessible.
In the original macro, the block name (Block6, lines 64 and 66) was hard-coded. A message is displayed at runtime if it no longer exists in the part document.
I made a small change to the macro that allows you to choose the block from a drop-down list of all the blocks available in the part document.
This avoids interfering in the code.
With this change, the block is found even if the insertion sketches have been deleted. This would seem to indicate that he " survives " in SW's item base. Not sure if he is still present after the recording of the piece, then closing/reopening...
GenerationCr.swp (91.5 KB)
Hello
Wouldn't it be simpler to create a file like the attached including the volume of the blank as well as an extrusion of the block defining the rack, constrained tangent to the primitive Ø and to repeat extrusions by modulating the angle and the displacement of the rack?
Generation Rack TEST. SLDPRT (130.5 KB)
Hello
This is exactly what macro does... Its only interest is to automate the task, to save yourself the chore of doing it manually.
Hello
I have made good progress on the rack generation version for a straight tooth. I'm now trying to make a version for helical teeth. For the straight version, every time a sketch is created, there is an extruded material removal. The superposition of all the cuts gives the teeth obtained.
For the helical version, I create a helix corresponding to the pitch of the teeth to be generated. On the other hand, when I want to do the repetitions of the block containing the rack, the sketches generated are well placed but the removal of the swept material is always done on the starting propeller. I can't repeat the propeller so that each swept cut is made according to a helix whose starting point is constrained to the sketch of the rack. I don't know if I'm clear enough in my explanations. I would like to be able to create a circular repeat of a propeller but I can't select this function in the circular repeat menu. Attached is the file and the macro that do not work.
Rack and pinion generation with propeller. SLDPRT (206.2 KB)
Bonjour:
Tu cherche à faire ceci ?
Hello
These tutorials allow you to make graphic representations of teeth. I want to generate the profile of a real tooth from the definition of the tool used to make it.
Hello
Material removal by scanning the volume of the tool must answer this question.
And then you just have to do the circular repetition of the number of machining.
NB: the advantage of this function compared to straight section scanning is that this function also generates the volume removed by the tool's tailgating
I didn't send the right files to the base, here attach the file and the macro to do the repetitions.
Rack and pinion generation with propeller. SLDPRT (206.2 KB)
Generation helical toothed rack.swp (75 Ko)
By launching the macro with 0 repetitions (1 single cut) and the angle at 1°, it's good. As soon as I start several repetitions, the swept cuts are always made according to the curve of the initial propeller and it no longer works. I want the different swept cuts to be made according to propellers that rotate 1° with each cut. I can't get the data from the curve (propeller) so that it can be repeated.
Hello
Unfortunately, I do not have the SW 2024 version, which prevents me from viewing your documents.
This being the case, it is clear that the propeller used for the sweeping must accompany the rack in its movement. It is controlled by the StartAngle parameter of the InsertHelix function.
Note that the parameters of this function are numerous and unclear, as is often the case with SW APIs.
The joined macro takes the previous one created for a straight tooth, adding the helical tooth option, in the form of the function named " GenererHelicoidal Denture".
It has only been tested on the attached example, so without guarantee...
GenerationCr.swp (149 KB)
GenerationCrHelicoidale.SLDPRT (86.7 KB)
Thank you, already the propeller repeat is working. I'm going to try to integrate it into my macro.
PS: do you use an AI? If so, which one? I try with chatgpt but it's laborious.