如何在不使用autocad命令提示符的情况下在autocad 2013中添加加载插件。 [英] How to add load plugin in autocad 2013 without using command prompt of autocad.
本文介绍了如何在不使用autocad命令提示符的情况下在autocad 2013中添加加载插件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I want to create an C# Window Application that will lanch the AutoCad and will load the external plugin
我尝试了什么:
我试过
What I have tried:
I tried
cad_app.ActiveDocument.SetVariable("Filedia", "0")
cad_app.ActiveDocument.SendCommand(@"Netload C:\ObjectARX 2013\samples\dotNet\HelloWorld\bin\HelloWorld.dll")
但它需要在Autocad的命令窗口输入或空格。
But It Require enter or space in command window of Autocad.
推荐答案
using System.IO;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
[CommandMethod("OpenDrawing", CommandFlags.Session)]
public static void OpenDrawing()
{
string strFileName = "C:\\campus.dwg";
DocumentCollection acDocMgr = Application.DocumentManager;
if (File.Exists(strFileName))
{
acDocMgr.Open(strFileName, false);
}
else
{
acDocMgr.MdiActiveDocument.Editor.WriteMessage("File " + strFileName +
" does not exist.");
}
}
Souce:创建和打开绘图(.NET)|搜索| Autodesk知识网络
这篇关于如何在不使用autocad命令提示符的情况下在autocad 2013中添加加载插件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文