我们可以通过以下两个函数来执行CAD命定: [DllImport("acad.exe", CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl)] extern static private int ads_queueexpr(string strExpr); [DllImport("acad.exe", CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl, EntryPoint = "?acedPostCommand@@YAHPB_W@Z")] extern static private int acedPostCommand(string strExpr); 这个两个 函数要用到 using System.Runtime.InteropServices;