Create a Macro that uses the "Mechanically Welded Element" function

Hello
I want to create a Macro that allows me to use the "Mechanically Welded Element" function on a sketch

  1. The idea is to choose the sketch
  2. Choosing the Standard
  3. Choosing Type
  4. Choosing the Size
    Then the macro selects the contours/lines and arcs. (there will be several dressing groups)
    I'm using SolidWorks 2023
    Thank you for your help

You can use this example as a basis:
https://help.solidworks.com/2023/English/api/sldworksapi/Insert_Structural_Weldments_Using_Custom_Weldment_Profile_Example_VB.htm?verRedirect=1
On the other hand, it's not easy to achieve, especially to know when to change bands automatically, it's going to be complicated.

4 Likes

Hello @Farouk ,

It is possible to automatically construct welded elements associated with each of the entities of a sketch. I completed the module for converting splines to arcs by adding a procedure that allows you to generate these welded elements.

Weaknesses: Agree with @sbadenis, the automatic division of entities into groups is a real headache. The module I offer does not allow this.
It therefore generates as many welded elements as there are sketch entities, all with the same profile. Hence a large number of bodies that weigh down the treatment of the piece...

This leads to the question of how to manage the model:

  • at least by dividing it into several basic sketches, each corresponding to a section profile;
  • And why not by dividing it into several pieces, grouped together in an assembly: the left lion, the right lion, the central sun, the lower band...

Version 2 of the executable module is attached, to be tested without moderation.
Kind regards.
AppliBiArc_2.zip (1.9 MB)

3 Likes

Hello

Thank you very much for your very valuable help @m.blt .
Thank you also @sbadenis for your suggestion.

Yes, I imagined that the selection of the outlines would be a real challenge.

I'll do some tests and give you feedback.

Hello again @m.blt
I had this mistake, any idea about the reason?

Hello @Farouk,

It is difficult to know where the problem lies on the basis of this single message.
What is amazing is the number of arcs per spline segment which seems to be 3 when the value should be even. Neither the graduated bar nor the associated input box should allow you to display an odd value...

Either there is a roundabout way to get there, or the basic sketch has an unforeseen peculiarity. Can you send it to me for a more in-depth analysis?

Hello
I'm attaching the file to you, usually I have even values

Ramadhan Karim (Gift for Customer) 3M.SLDPRT (291.6 KB)

Alas, future version...
I only have SW 2022, please regenerate the model in this version.

Hello again @m.blt
I am attaching the SolidWorks 2022 file,
It had the same error code. He also selected an odd number.
P1.SLDPRT (3.0 MB)


Thank you for your support