AnsweredAssumed Answered

Open New Solidworks Instance

Question asked by Eric Jacobson on Nov 26, 2018
Latest reply on Nov 27, 2018 by Eric Jacobson

Hey, All;

 

I have this bit of code I've written for a windows form that opens a drawing when a barcode is scanned.

 

My issue is that the drawing opens in the primary solidworks instance (I.E: if there are 3 instances running, it opens in the first opened instance).

 

My colleagues would like this to open a new solidworks instance and I'm not entirely certain how to do this. I would think it involves the process.start line, but I have no idea how to resolve it... I feel like it's something simple and I'm just too new to this to get it.

 

Anyone have any ideas?

 

 

 

 

 

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

        Try

            Dim barcode As String = tb_barcode.Text

            Dim filename As String = tb_barcode.Text

            'Add File Extension to end of path

            Dim ext As String = ".SLDDRW"

            'Split job number from detail number in barcode textbox

            barcode = Split(tb_barcode.Text, ".")(0)

            filename = Split(tb_barcode.Text, ".")(1)

            'File path with jobnumber/detail number variables

            System.Diagnostics.Process.Start("G:\Fixtures\" & barcode & "\Details\" & barcode & " DET " & filename & ext)

        Catch

            MessageBox.Show("File Not Found")

        End Try

    End Sub

End Class

Outcomes