AnsweredAssumed Answered

how to open an existed part file by VB studio

Question asked by Shu-Huang Sun on May 7, 2019
Latest reply on May 7, 2019 by Abhishek Lad

I write a VB 2010 program as the following. I hope to open an existed part file by this program automatically. However, I always get an error message. Can anyone help me to check where this program is wrong. Thank you very much.


Imports SolidWorks.Interop.sldworks

Imports SolidWorks.Interop.swconst


Public Class Form1

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

        Dim swapp As New SldWorks

        Dim model As ModelDoc2

        swapp.Visible = True

        model = swapp.OpenDoc6("D:\samples\part.SLDPRT", 1, 0, "", 0, 0)

    End Sub

End Class