Hi,
I have a SolidWorks macro that saves filetypes from a part drawing, ie. with the drawing open, you select the filetypes to save, and the macro opens the model and saves the files.
I am trying to make a DLL using Visual Basic, and have copied across the macro to Visual Basic 2005 Express.
When I run the macro, it creates a 'Type Mismatch' error when it runs the segment of code that saves the filetype.
The segment of code looks like:
If WantParasolid.Checked = True Then 'Save off Parasolid File bRet = swDrawModel.SaveAs4("C:\fred.x_t", _ swSaveAsCurrentVersion, _ swSaveAsOptions_Silent, _ nErrors, _ nWarnings) End If
Earlier the declarations were:
Dim iSwApp As SldWorks.SldWorks Dim iSwModel As SldWorks.ModelDoc2 Dim swDrawModel As Object
Dim bRet As Boolean Dim swSaveAsCurrentVersion As Long Dim swSaveAsOptions_Silent As Long Dim nErrors As Long Dim nWarnings As Long
swDrawModel = iSwApp.OpenDoc6(sFullFilePath, DocType, 0, "", nErrors, nWarnings) swDrawModel = iSwApp.ActivateDoc(ModelName)
Can anyone help?
Thanks