Macro VBA Solidworks

Hello

I have a bug on a simple macro recording a sequence of instructions in SOLIDWORKS, if someone can provide me with a clarification.
Kind regards.
Spectrum.

in yellow ...
Etrier.swp (43 KB)

myDimension.SystemValue = 0.1

Hello

StudyManagerObj does not exist so error (no associated variable declaration)

1 Like

Hello

So I added:
Dim swApp As Object
Dim StudyManagerObj As Object

Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long

*otherwise I found this information:

do this by going to the VBA editor, clicking on "Tools" in the menu bar, and then selecting "References".

But why, during a simple registration, does the generated code have an anomaly...
Thank you for the help in specifying the error generated by an automatic code.

1 Like

The code generated automatically by SW is generally partial.

Ok I understand I'll take the time to look at macros, and I'll post my progress. Thank you.

There are quite a few examples on this forum, otherwise the help of the API and a little research on the internet allows you to come across sites where there are other examples of macros developed by different SW users.
There is also the VBA FAQ for the standard functions of vb

1 Like