seedie54
Automotive
- Dec 16, 2001
- 6
hello all,
Im looking to integrate Excel and Solidworks 2001. I am using Visual Basic 6.0. As a test, I tried the following code, to extract data from Solidworks, and display on the screen:
Sub Command1_Click()
Dim swApp As Object
Dim Part As Object
Dim Length As Double
Set swApp = CreateObject("SldWorks.Application"
SwApp.Visible = True
swApp.UserControl = True
Set Part = swApp.ActiveDoc
Set Length = Part.Parameter("Line1@Sketch1".SystemValue
MsgBox("Line1 in sketch1 is of length: " & length & "."
End Sub
I did this in Visual Basic as a Standard EXE (on a button click), not as a Macro. Solidworks is open at the time, and the sketch active.
Do i have to use macros?? If i use VB6.0, do i have to declare functions from .dll's?? if so, how do i know which functions are in which .dll??
When compiling, VB didnt like the line "Set Length = ..."
Any assistance is greatly appreciated
API Beginner
Im looking to integrate Excel and Solidworks 2001. I am using Visual Basic 6.0. As a test, I tried the following code, to extract data from Solidworks, and display on the screen:
Sub Command1_Click()
Dim swApp As Object
Dim Part As Object
Dim Length As Double
Set swApp = CreateObject("SldWorks.Application"
SwApp.Visible = True
swApp.UserControl = True
Set Part = swApp.ActiveDoc
Set Length = Part.Parameter("Line1@Sketch1".SystemValue
MsgBox("Line1 in sketch1 is of length: " & length & "."
End Sub
I did this in Visual Basic as a Standard EXE (on a button click), not as a Macro. Solidworks is open at the time, and the sketch active.
Do i have to use macros?? If i use VB6.0, do i have to declare functions from .dll's?? if so, how do i know which functions are in which .dll??
When compiling, VB didnt like the line "Set Length = ..."
Any assistance is greatly appreciated
API Beginner