none
c# cad실행

    질문

  • vb.net로 작업 하였습니다.
    c#으로 전환하려는데
    잘 않되서 고민하다 올립니다.
    c# 2012이고 autocad 2014입니다.

    Imports AutoCAD    
    Imports AutoCAD.AcadDocumentClass 

    Module CAD_현도
        Dim acadApp As AutoCAD.AcadApplication
        Dim acadDoc As AutoCAD.AcadDocument
        Dim acadutil As AutoCAD.IAcadUtility
        Dim moSpace As AutoCAD.AcadModelSpace
        Dim DWGNAME As String

        Sub 각구마루_dwg(가로 As Double, 세로 As Double, 호 As Double, 높이 As Double, 지름 As Double)

            DWGNAME = App_Path() & "AHU_DWG\판넬전개도.dwg"
            '-------------------------------------------------------------------------
            On Error Resume Next
            acadApp = GetObject(, "autocad.Application")
            If Err.Number <> 0 Then
                Err.Clear()
                acadApp = CreateObject("autocad.Application")
            End If
            acadApp.Visible = True
            Err.Clear()
            acadDoc = acadApp.Documents.Open(DWGNAME, False)
            '-------------------------------------------------------------------------
            acadDoc = acadApp.ActiveDocument
            acadutil = acadDoc.Utility
            moSpace = acadDoc.ModelSpace
          
            '=============================================================

            For I = 0 To 8    '6
                start_point(0) = e_point(0) 'x 포인트
                start_point(1) = e_point(1) 'y 포인트
                start_point(2) = e_point(2) 'z 포인트
               
                end_point(0) = COUNT_X(I) 'sm1.Cells(3, I + 1) 'x 포인트
                end_point(1) = COUNT_Y(I) 'sm1.Cells(4, I + 1) 'y 포인트
                end_point(2) = 0          'sm1.Cells(5, I + 1) 'z 포인트

                lineobj = moSpace.AddLine(start_point, end_point) '라인그리기

                e_point(0) = end_point(0)
                e_point(1) = end_point(1)
                e_point(2) = 0 'end_point(2)
            Next I

            acadDoc.Regen(AcRegenType.acAllViewports)
            acadDoc.Application.ZoomExtents() 
            AppActivate(acadApp.Caption)    

            acadDoc.SaveAs(save화일명)
            acadDoc.Close()

        End Sub

    End Module

    2018년 11월 5일 월요일 오전 10:11

답변