Save As TArch3


程序代码:

    Private Shared Declare Function SaveAsTArch3_64 Lib "tch_kernal.arx" Alias "?SaveAsTArch3@@YAHPEAVAcDbDatabase@@PEB_WH_N@Z" (db As System.IntPtr, <System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.BStr)> path As String, param1 As Integer, param2 As Boolean) As Integer

        Private Shared Declare Function SaveAsTArch3_32 Lib "tch_kernal.arx" Alias "?SaveAsTArch3@@YAHPAVAcDbDatabase@@PB_WH_N@Z" (db As System.IntPtr, <System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.BStr)> path As String, param1 As Integer, param2 As Boolean) As Integer

        Public Shared Function SaveAsTArch3(db As Database, output_file As String) As Boolean
            Try
                Dim flag As Boolean = CommonFunction.Is64Bit()
                If flag Then
                    CADFunction.SaveAsTArch3_64(db.UnmanagedObject, output_file, 17, False)
                Else
                    CADFunction.SaveAsTArch3_32(db.UnmanagedObject, output_file, 17, False)
                End If
                If System.IO.File.Exists(output_file) Then
                    Return True
                End If
            Catch ex_3B As System.Exception
            End Try
            Return False
        End Function

        Public Shared Function SaveAsTArch3(file As String, output_file As String) As Boolean
            Try
                Dim database As Database = New Database(False, True)
                database.ReadDwgFile(file, System.IO.FileShare.ReadWrite, True, "")
                Dim result As Boolean = CADFunction.SaveAsTArch3(database, output_file)
                database.Dispose()
                Return result
            Catch ex_28 As System.Exception
            End Try
            Return False
        End Function




Visual Studio 2019 key 序列号



欢迎关注微信公众账号ByCAD