프로그램/C#(autocad)

C#을 이용하여 Command 창에 명령

dongchul74 2012. 1. 16. 13:48



using System.Runtime.InteropServices; 와

using Autodesk.AutoCAD.DatabaseServices; 을 추가해준다.


아래와 같이 코딩하여 적용할 수 있다. 

[DllImport("acad.exe", CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl)]

            extern static private int ads_queueexpr(string strExpr);


Autodesk.AutoCAD.ApplicationServices.Document doc;

            doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;           

            doc.SendStringToExecute("._CIRCLE 10,0,0 1000 ", true, false, false);   //<-- 간격이 스페이스 입력이 된다. 마지막에 꼭 한칸 띄어주자

'프로그램 > C#(autocad)' 카테고리의 다른 글

명령창[command window] 띄우기  (0) 2014.08.05
Zoom Extents  (0) 2012.01.20
autocad dimension 시스템 변수  (0) 2011.11.30
[스크랩] AutoCAD 시스템 변수  (0) 2011.06.21
[Error]Elock Violation  (0) 2010.11.02