Macro Boss/Swept Base Solidworks

Hello

I want to make a macro with a swept boss / base. 

I started by making a recording by doing all the necessary steps to make a boss (sketch selections, guides...)

However, I can't use the function that the macro editor gives me:

"InsertProtrusionSwept3 False, False, 8, False, False, 1, 1, False, 0, 0, 0, 0, False, True, True, 21.9911485751286, True, True, True, False"

When I observe the progress of the macro step by step, I manage to select my 2 entities, but the function crashes the program...

 

Does anyone have a solution?

 

Thank you
 

Hello, what will this macro be used for?

1 Like

To realize a function to create springs of all types (number of turns, outer diameter, wire diameter, height, conical or non-conical ends..)

1 Like

if it is for the creation of a spring see this link

http://www.lynkoa.com/forum/3d/modelisation-de-ressort-sous-sw2014

it is configurable and which from + is moved according to the compression 

@+

3 Likes

Hello

In this case, it may be easier to create configurations or use DriveWorks:

https://www.youtube.com/watch?v=BZSizOjfBtw

 

3 Likes

Yes, making a configurable part would be more judicious....

1 Like

But if I really need a macro, I can try to regade!

Here is some information on the method: http://help.solidworks.com/2015/english/api/sldworksapi/SOLIDWORKS.Interop.sldworks~SOLIDWORKS.Interop.sldworks.IFeatureManager~InsertProtrusionSwept3.html

And an example in vba: http://help.solidworks.com/2015/english/api/sldworksapi/Get_Guide_Curves_in_Sweep_Feature_Example_VB.htm

 

Thank you, for all your answers!

I thought about the configurations except that I have too many parameters to change for each spring (I'll give you an example of a spring that I may have to make ;)):

 - Outer diameter

- Wire diameter

- Number of coils (middle, upper and lower part of the spring)

- Upper and lower part, conical or not

- Height of the lower and upper parts

- Coincident elements of the spring

-...

My macro starts well with my inputbox and msgbox which draws my sketches, I only have trouble interpreting the scan function, and I went to the help but I can't understand how it works yet.

I had also tried some time ago the "assembly" spring like gt22, advised me but I need to be able to change the number of turns.

Thank you again for your messages

The problem with the scan and smoothing functions

they must not touch each other

all your coils must not fit in. Contact with each other 

 

in surface it's a little more flexible