Variable Sketch Repetition

It's insulting... No AI for @m_blt ... it is the AI that should use @m_blt macros to be effective!

3 Likes

Hello
Sorry @m_blt if I sounded insulting. Being a beginner in VBA and not having the vocation to make it my profession, AI (and video tutorials too) still help me a lot to understand the different functions used in macros and to do things by myself. A big thank you @m_blt for all the codes you share and the time you spend on them.

Hello @john_john you can relax, no one really believed that you wanted to be derogatory, my remark was not to be taken at face value :wink:

Bah! @m_blt has been one of our Non-Artificial Intelligence since at least January 11, 2000. (ahead of its time).
image

1 Like

Thank you for these compliments, the blush goes up my cheeks...
Aside for @Maclane : no need to age me more than I should, my registration dates from 2020 :wink: .
image
Suspecting me of consulting an AI is not insulting, I have already questioned ChatGPT or Le Chat, mainly as search tools in SW functions.
A typical example here: " What function of SW APIs generates a propeller?" 

ChatGPT's response:
La fonction CreateHelix ou la méthode CreateHelixFeature de l’objet IModeler
All this is pure invention, none of these functions exist.
The structure HelixFeatureData mentioned later in his answer has a reality.
The example that comes next seems more attractive with the correct InsertHelix()function, but whose parameters are out of order and incorrect for some.

For its part, Le Chat proposes to create a helix, a fundamentally 3D curve, in a 2D sketch. No comment...
Then check out the SolidWorks API documentation for more details!

In general, a lot of time spent for a random result. Even if I remain convinced that it is only a matter of time before AI becomes effective in this specific field.
Other sources of inspiration, more effective:

  • SW APIs, including examples, as well as codestack APIs.
  • macros generated by SW itself, although the abuse of the Object type for variables sometimes requires tedious searches to find their precise types and members.

And a few years of practice, even if it's in a different context than that of SW APIs and VBA...

4 Likes

:rofl::rofl: :rofl: Sorry for the 20 more years!! :rofl: :rofl: :rofl:
But what do you want: " Talent does not wait for the number of years." 

I agree with you on the use of AI Vs help of SW + CodeStack APIs ... As much as AI is not (yet) perfect and if it starts hallucinating, such as by creating non-existent functions in APIs, it's a wasted effort. But it's only a matter of time.
But learning, in my opinion, should not be done with AIs but with real people who have real reasoning and good expertise... or at worst via " serious " sites

On the other hand, I use AI to comment on my codes... there the AI is not too bad and above all it makes much fewer spelling mistakes than me... :sweat_smile:

Hello, too bad you can't open the files. In the .part file, I have a sketch with all the parameters to define the tooth profile.
Profil de crémaillère + données
Then I have a sketch to retrieve the tooth profile and create a repetition (base of the block created later).
Crémaillère
Then I create the raw with Ø foot, Ø head and Ø primitive.
création brut
Then I create the propeller with the parameters that are fine for my case (I calculate them in my 1st sketch Données_denture but I can't get them to use them in the propeller parameterization, the data fields only accept numerical values). The base circle of the helix is the primitive Ø which is converted from the rough sketch.
hélice
Finally, I create a BLOCK sketch in which I take the rack and transform it into a block. I do this so as not to " break " my housewarming sketch and to be able to go back without having to rebuild everything.
esquisse BLOC
When I launch the macro
Generation helical toothed rack.swp (77.5 KB)
The swept cuts are always made following the same helix.
I tried to understand how you did to repeat the propellers to integrate it into the macro but I'm drying... In addition I think that in my case, I have to recover the existing propeller in order to copy the parameters for the repetitions and there I dry even more.

Hello

If your tooth profile is the sketch hidden under the big pile of dimensions, it doesn't seem to me to be a valid (or at least relevant) profile for your propeller.

Hello @john_john ,

I don't have my usual PC on hand, and the one I have is limited to SW 2023. I can load the macro, not the part document...

But, unless I'm mistaken, your 2024 version has the option to save in SDLPRT format from 2023 or 2022, by doing a " Save as ".
If that's the case, post your piece in one of these two versions, I'll look at your macro as soon as possible...

Blank Generator File Rack with Propeller - AMELIORE SW2023.SLDPRT (195.7 KB)
Blank file generating rack with propeller - AMELIORE SW2022.SLDPRT (196.2 KB)
There you go :wink:
Have a good weekend

Hello @Sylk ,

No need to worry: the sketch represents the tooth profile, repeated in N copies, to define the rack responsible for machining the gear wheel.

The helix is the curve that the rack must follow to generate the teeth.
Helical as its name suggests.

All this while ensuring that the primitive line of the rack rolls without slipping on the primitive circle of the pinion. In short, a kinematic puzzle, to be combined with the Solidworks puzzle, married to the VBA macro puzzle.

The solution exists...

Hi @m_blt

What I wanted to say is that, at my limited level of knowledge, a profile, let alone repeated, should look more like this green line than the red line:
image
Maybe I'm wrong.

Or maybe I didn't understand anything about the question, which is very likely.

Hello @john_john ,

Nothing new in the attached macro, it is almost identical to the principle of the one posted previously.
At each step of the calculation, two elements must be positioned:

  • the rack (sketch block), and
  • the propeller (curve) which is used to control the removal of swept material.
    The principle works, but the use of scanning makes it more susceptible to SW calculation rejections than the straight-toothed version that uses extrusion removal.
    image

Below 2 degrees of angle increment, the function is rejected by SW for certain positions. Maybe the fact of tiny " machining areas" that he has trouble managing. Would SW know the notion of minimum chips...
Simplifying the tooth profile could perhaps improve this.

One last remark: the perimeter of the primitive circle is not an integer multiple of the gear pitch of the rack. Wanted or not?

Generation helical gear rack.swp (110.5 KB)
FileGenerationRackPropellerSW2022.SLDPRT (4.0 MB)

2 Likes

Good evening
This case is a bit special because the tool module (and therefore its pressure angle) is modified to obtain a slightly different profile. The helix angle is also modified, which slightly changes the pitch of the propeller. The corrected data are in the sketch Données_denture and are used to calculate the original diameter on which the rack rolls. I think that's why some cuts are " in a vacuum " if the angular increment is small.
EDIT: it doesn't come from there, you're right there are construction errors.
I go from this after the next cut helix 13
image
to this at the next cut:
image

Do you think that shifting the initial plan from the raw part could improve things?

Hello @Jonathan_VIALLE ,

I notice the same phenomenon, a singularity appears after about fifteen steps (N+1), persists at the next step, and then becomes monstrous.

image
I suspect digital anomalies from the removal of tiny material in certain areas, which SW has trouble managing, and which cause it to completely break down.

By observing the " successive machining" in more detail, we can note that less visible anomalies occur earlier in the sequence: the generators of the tooth profile converge at the same point...
image

Suspicion of digital artifact confirmed by choosing a larger angular increment (2.5 degrees), over 40 steps: no more anomaly, the visual appearance of the teeth is correct.
I don't think that a shift in the initial plan can improve things.

ok so problem difficult to solve...
With a large angular increment, the resulting trochoid is too coarse. My goal is to precisely measure the starting Ø of the circle involute.

I will generate only the sketches and try to recover a totally generated " hollow " of the tooth (by hand in the worst case). This will allow me to have the starting Ø developing. Then I can do the swept cut of a tooth and repeat it to get the complete dentition.

Hello @m_blt
And with a reconstruction after each step?