随笔分类 -  AUTOCAD二次开发

摘要:这代码挺有用的,当时帮我解决了很大的问题,感谢NetObjArx编程论坛的lzx838在 网上共享出来的代码。 Editor ed = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor; DocumentCollection ... 阅读全文
posted @ 2013-09-08 20:12 一点味 阅读(562) 评论(0) 推荐(0)
摘要://定义事件 Editor ed = doc.Editor; ed.PointMonitor += new PointMonitorEventHandler(ed_PointMonitor); //事件执行函数 void ed_PointMonitor(object sender, PointMonitorEventA... 阅读全文
posted @ 2013-09-08 20:06 一点味 阅读(1248) 评论(0) 推荐(0)
摘要:http://www.objectarx.net/forum.php?mod=viewthread&tid=1243 阅读全文
posted @ 2013-09-08 20:05 一点味 阅读(670) 评论(0) 推荐(0)
摘要:Autocad的系统变量, 我们可以通过如下得到: Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable(/*MSG0*/"TILEMODE"); 但是有些是写在drawing,有些是registery. ----------------------------------------------------... 阅读全文
posted @ 2013-09-08 20:03 一点味 阅读(1246) 评论(0) 推荐(0)
摘要:using System.Speech.Synthesis; SpeechSynthesizer sSpeechSynthesizer = new SpeechSynthesizer(); sSpeechSynthesizer .Speak("化肥会挥发!!!"); 注:xp不支持中文 如何获取程序当前目录 System.IO.Path.GetDirectoryName(Ap... 阅读全文
posted @ 2013-09-08 19:43 一点味 阅读(713) 评论(0) 推荐(0)
摘要:'获取CAD屏幕像素的比值 Function ViewScreen() As Double Dim ScreenSize As Variant ScreenSize = ThisDrawing.GetVariable("screensize") '当前视口的屏幕宽度和高度 Dim H As Variant H = ThisDrawing.GetVariable("views... 阅读全文
posted @ 2013-09-08 19:27 一点味 阅读(579) 评论(0) 推荐(0)
摘要:C#实现在CAD图纸中插入另一个DWG图块的代码PromptPointResult ppr = ed.GetPoint("请选择插入点:"); Point3d pt = ppr.Value; utility.WriteToEditor(pt.ToString()); PIDBlock pidBlock = new PIDBlock();//自己定义的图块类,保存图块的路径和名称 pidB... 阅读全文
posted @ 2013-09-06 23:36 一点味 阅读(2415) 评论(2) 推荐(0)