I'm a API's beginner
I made VB code below using macro recorder, but can not run...
And I cannot find out reason..
Please help me
Error : cannot open ***.dll
=============================================
Imports SolidWorks.Interop.sldworks
Imports SolidWorks.Interop.swconst
Imports System
Partial Class SolidWorksMacro
Public Sub main()
Dim swDoc As ModelDoc2 = Nothing
Dim swPart As PartDoc = Nothing
Dim swDrawing As DrawingDoc = Nothing
Dim swAssembly As AssemblyDoc = Nothing
Dim boolstatus As Boolean = false
Dim longstatus As Integer = 0
Dim longwarnings As Integer = 0
swDoc = CType(swApp.ActiveDoc,ModelDoc2)
boolstatus = swDoc.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
boolstatus = swDoc.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, True, 0, Nothing, 0)
Dim myRefPlane As RefPlane = Nothing
myRefPlane = CType(swDoc.FeatureManager.InsertRefPlane(8, 0, 0, 0, 0, 0),RefPlane)
swDoc.ClearSelection2(true)
boolstatus = swDoc.Extension.SelectByID2("Front Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
swDoc.ClearSelection2(true)
boolstatus = swDoc.Extension.SelectByID2("Plane1", "PLANE", 0, 0, 0, true, 0, Nothing, 0)
myRefPlane = CType(swDoc.FeatureManager.InsertRefPlane(8, 0.2, 0, 0, 0, 0),RefPlane)
swDoc.ClearSelection2(true)
boolstatus = swDoc.Extension.SelectByID2("Plane1", "PLANE", 0, 0, 0, false, 0, Nothing, 0)
swDoc.ClearSelection2(true)
End Sub
Public swApp As SldWorks
End Class
