

- #Solidworks 2010 bump bend part how to#
- #Solidworks 2010 bump bend part software#
- #Solidworks 2010 bump bend part code#

You should have a good idea of where to go from there. Set swApp = CreateObject("SldWorks.Application") Once you’ve created a new macro, you’ll need to go to Tools–>References and add in “SldWorks 20XX Type Library”.
#Solidworks 2010 bump bend part how to#
Now that we know how to run Excel from SolidWorks, let’s do just the opposite. Interesting in learning how to create a 3D point cloud in SolidWorks using point data stored in an Excel spreadsheet? Check out Lesson 7.1 on our Videos page. Two notes: 1) The Win32 API call is used to properly shut down Excel, otherwise a residual EXCEL.EXE process can remain that interferes with future attempts to use Excel, 2) If you get a compile error that says “User-defined type not defined”, it probably means that you did not set the correct references. SwApp.SendMsgToUser2 Cells(row, 1).Text, swMbInformation, swMbOk (Place this sample spreadsheet in C:\ to use the following example.) Make sure that Excel is not already open while you run this code.ĭeclare PtrSafe Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As LongPtr, ByVal wMsg As Long, ByVal wParam As LongPtr, ByVal lParam As LongPtr) As Longĭeclare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
#Solidworks 2010 bump bend part code#
As an example, here’s some code that will display a message box for each row in the first column of a spreadsheet. Indeed, unlike SolidWorks, there is no “Excel API Help” contained with Excel. Beyond that, learning how to work with the Excel API is really just as simple as using the Object Browser and Google a lot. Notice its similarity to the code we use to get ISldWorks. Now, to connect to Excel we’re going to use this code:

So that’s what SolidWorks Corporation chose to do-use VBA as one way to create macros in SolidWorks.
#Solidworks 2010 bump bend part software#
They also made VBA available to third-party software developers (like SolidWorks Corporation) to integrate in their software. Why is it so easy to integrate the Excel and SolidWorks APIs using Visual Basic for Applications? Microsoft created VBA as a way for users to program with the APIs of their Office products. As a bonus, I’ll also cover how to include an Excel macro in SolidWorks design table. While I am not going to cover all of the material presented in that lesson, I do want to provide you with a basic run-down of using the Excel API in a SolidWorks macro, and vice versa. Given the ubiquity of Microsoft Excel in engineering departments worldwide, it is no surprise that our “Using Microsoft Excel with the SolidWorks API” tutorial, available to Premium members, is one of our most popular.
