Your Products have been synced, click here to refresh
Private Sub openCMMFile(ByVal index As String) // some sql code goes here . . // Dim tempfiledirectory As String = "" tempfiledirectory = Path.Combine(Application.StartupPath, "TempFolder") tempfiledirectory = Path.Combine(tempfiledirectory, tbl.Rows(0)("filename")) Dim fs As FileStream = New FileStream(tempfiledirectory, FileMode.Create) Dim bytes As Byte() = CType(tbl.Rows(0)("Blob_Data"), Byte()) fs.Write(bytes, 0, bytes.Length) fs.Close() Dim app As PCDLRN.Application Dim partPrograms As PCDLRN.PartPrograms Try app = CreateObject("PCDLRN.Application") app.OperatorMode = True app.Visible = True partPrograms = app.PartPrograms partPrograms.Open(tempfiledirectory, "") app.ActivePartProgram.EXECUTE() app.ActivePartProgram.Close() File.Delete(tempfiledirectory) Catch ex As Exception MsgBox("PcDmis cannot connect. " & vbNewLine & "(Error - " & ex.Message & ")" & vbNewLine & ex.ToString, MsgBoxStyle.Critical) End Try End Sub
Private Sub openCMMFile(ByVal index As String) // some sql code goes here . . // Dim tempfiledirectory As String = "" tempfiledirectory = Path.Combine(Application.StartupPath, "TempFolder") tempfiledirectory = Path.Combine(tempfiledirectory, tbl.Rows(0)("filename")) Dim fs As FileStream = New FileStream(tempfiledirectory, FileMode.Create) Dim bytes As Byte() = CType(tbl.Rows(0)("Blob_Data"), Byte()) fs.Write(bytes, 0, bytes.Length) fs.Close() Dim app As PCDLRN.Application Dim partPrograms As PCDLRN.PartPrograms Try app = CreateObject("PCDLRN.Application") app.OperatorMode = True app.Visible = True partPrograms = app.PartPrograms partPrograms.Open(tempfiledirectory, "") app.ActivePartProgram.EXECUTE() app.ActivePartProgram.Close() File.Delete(tempfiledirectory) Catch ex As Exception MsgBox("PcDmis cannot connect. " & vbNewLine & "(Error - " & ex.Message & ")" & vbNewLine & ex.ToString, MsgBoxStyle.Critical) End Try End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |