xhsd 发表于 2013-4-9 18:36:00

C#外部程序如何使用com的方式启动cad

如题,C#外部程序如何使用com的方式,通过引用acaxenu16.tlb启动cad?

sieben 发表于 2013-4-9 22:10:00

不是,搜。

guohq 发表于 2013-4-10 10:52:00

'''
    ''' 启动指定版本的CAD
    '''
    '''
    ''' 返回CAD Application ,如果失败,则返回 Nothing
    '''
    Public Function StartCAD(Optional ByVal VerStr As String = "") As Object
      Try
            Dim CadApp As Object = Nothing
            If VerStr.Trim = "" Then
                CadApp = Microsoft.VisualBasic.CreateObject("Autocad.Application")
            Else
                CadApp = Microsoft.VisualBasic.CreateObject("Autocad.Application." & VerStr.Trim)
            End If
            CadApp.Visible = True
            CadApp.WindowState = 3
            Return CadApp
      Catch ex As Exception
            Return Nothing
      End Try
    End Function
vb版的,改改就能用
页: [1]
查看完整版本: C#外部程序如何使用com的方式启动cad