VBA List

Following my last question about the dxf export macro of a family of parts, I would like to improve this macro.

 

As my knowledge is quite weak on the subject, I would like to know if it was possible to have a kind of list of the different codes that can be typed in VBA.

 

With their explanations. it will allow me to know a little + on the subject and to improve my macro on my own (well I hope^^)

I'm attaching my macro just in case

Thank you!


export_dxf_famille_de_piece.swp
2 Likes

Hello

So you're talking about the VBA SolidWorks? Because it could concern Excel, AutoCAD, and many others!

Since there are thousands of instructions depending on what you want to do (in a part, an assembly, a plan, retrieve the value of a dimension, the color of a face), there is no simple list, but the help of SolidWorks is rather well done:

http://help.solidworks.com/2014/English/api/sldworksapiprogguide/Welcome.htm

And otherwise, a Google search will most of the time find what you want faster.

Edit with the following answer:

Afterwards, to start with, you can go through macro recording, but the problem is that the code is never optimized!

I advise you to watch my tutorials with commented macros, it allows you to see what each line does!

My commented tutorials:

http://www.lynkoa.com/tutos/3d/macro-solidworks-retirer-lecture-seule-pour-fichiers-de-bibliotheque

http://www.lynkoa.com/tutos/3d/macro-enregistrer-sous-avec-solidworks

 

3 Likes

Hello.

 

A rather good help that lists the main functions in VBA 

http://dominiquemaniez.developpez.com/access/fonctionsVBA/#LI

 

On the other hand, there is something to eat and drink and you have to sort it out.

 

And if not, the attached file in PDF. But I find it much less "nice" to use

 

EDIT: Non-clickable link becomes clickable


vba-minimal.pdf
4 Likes

Afterwards, to start with, you can go through macro recording, but the problem is that the code is never optimized!

I advise you to watch my tutorials with commented macros, it allows you to see what each line does!

My commented tutorials:

http://www.lynkoa.com/tutos/3d/macro-solidworks-retirer-lecture-seule-pour-fichiers-de-bibliotheque

http://www.lynkoa.com/tutos/3d/macro-enregistrer-sous-avec-solidworks

@coin37coin I think you're off topic because your info is about vba Excel and Access but not SolidWorks.

@.PL: It doesn't seem to me to be off-topic. And even if, it's information that can still be used to @Bart. The information is not only about Excel and Acess but about the VBA language. It seems to me that you know this, but VBA is a common language with specificities for each software.

A bit like if the VBA was French, excel the southern French, Access the French of Lille and Solidworks the French-Canadian (personally, I found many of my answers for Solidworks in pages for Excel for example)

 

3 Likes

@coin37coin:

Indeed, I had only seen the title "Visual basic minimal cheat sheet for Excel" but the part about Excel only starts on page 22.So there is some interesting information, mea culpa.

But in my opinion, VBA Excel and SolidWorks are not as close as the French and the French in Quebec!

By the way, your first link doesn't work (it ends with... and is not clickable!).

1 Like

It is indeed not clickable (why? no one knows!) But with a little copy and paste, it goes by itself;)

 

By the way, I would advise you to browse the site. I put a link to a page (not functional) but there are several interesting things in it

1 Like