我在visual sutio 2010中创建了表单并添加了按钮,当用户单击该按钮时,它应该打开Solid Works工具,因此代码是:
Imports SolidWorks.Interop.sldworks
Imports SolidWorks.Interop.swconst
Imports System.Runtime.InteropServices
Imports System
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
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
swDoc = CType(swApp.NewDocument("C:\ProgramData\SolidWorks\SolidWorks 2012\templates\Part.prtdot", 0, 0, 0), ModelDoc2)
swDoc = CType(swApp.ActiveDoc, ModelDoc2)
boolstatus = swDoc.Extension.SelectByID2("Top Plane", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
swDoc.SketchManager.InsertSketch(True)
Dim skSegment As SketchSegment = Nothing
skSegment = CType(swDoc.SketchManager.CreateCircle(-0.020947, 0.005368, 0, 0.012306, -0.016627, 0), SketchSegment)
boolstatus = swDoc.EditRebuild3()
End Sub
End Class
但不幸的是我在导入时遇到错误请帮助我错误是:
导入不包含任何公共成员或找不到