Code : Tout sélectionner
If Microsoft.VisualBasic.Right(path, 4) Like StrExtension1 Then
Dim splitname()
Dim NewName As String
Dim topapp As TopSolid.Application
Dim doc As TopSolid.Document
topapp = New TopSolid.Application
topapp.Visible = True
doc = topapp.Documents.Open(path)
splitname = Split(path, ".", -1, CompareMethod.Text)
NewName = splitname(0) & StrExtension2
If Microsoft.VisualBasic.Right(NewName, 4) Like ".dxf" Then
topapp.SetExportOption("dxf", "2000", "mm")
doc.SaveAs(NewName, False)
ElseIf Microsoft.VisualBasic.Right(NewName, 4) Like ".dwg" Then
topapp.SetExportOption("dwg", "2000", "mm")
doc.SaveAs(NewName, False)
End If
doc.Close(False, False)
topapp.Quit()
topapp = Nothing
doc = Nothing
End If