Can someone create the base code so that it uses "UserForm" as in this video for AutoCad?
AutoCAD VBA Programming Tutorial - YouTube
It just need to show the basic as in the video for AutoCad.
VBA in solidworks ?
And by the way increase view on your YouTube video
Maybe nobody is doing it because nobody understands the value. What is the point of this macro? To draw a square is trivial. What do you want to do with the macro? I doubt anybody except you will ever care about this macro. It's not challenging in any way. It does not show special capability. It is not interesting. It can't do a useful task for anyone. It's hard to get people to do things for you for free when they are none of those things.
I need to write in a few values and then code the VBA to draw 2D and 3D drawings.
I did it in AutoCad with "UserForm" as in the video, but I can not get the "UserForm" in SolidWorks 2009 to appear.
How do I get the "UserForm" to appear in SolidWorks so I can do the same in SolidWorks as in the video?
To get the "UserForm" to appear is probably something to install with the installation of SolidWorks.
This is not a trivial question.
It is indeed utterly trivial. There are multiple examples available online to show how to use UserForms in SolidWorks VBA macros.
Attached is your macro.
To run the macro, first you must have a part, assembly, or drawing file open.
Then, point to Tools→Macro→Run. Browse to where you have saved the attached .swp file. Select it, and hit "Open".
it's totally basic to show userform in SW- I think you need to learn some visual basic before start writing SW macro
Here is the code
Dim swApp As ObjectSub main()
Set swApp = Application.SldWorksUserForm1.Show
Retrieving data ...