Hi,
I know this topic is quite old, but while using the you provided I am getting this error.
expected class delegate enum interface or struct (at void)
I have modified the code to suit my needs please help me resolve it.
code
using Microsoft.Win32;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Runtime;
using acApp = Autodesk.AutoCAD.ApplicationServices.Application;
[CommandMethod("TLOD", CommandFlags.Modal)]
public void TLOD()
{
AcadDocument curAcadDoc = (AcadDocument)AcApp.DocumentManager.MdiActiveDocument.AcadDocument;
curAcadDoc.SendCommand("(vl-load-com) "/*space after closing paren!!!*/);
string lispPath = (string)Registry.LocalMachine.GetValue(@"SOFTWARE\XXXX\YYYY", "InstallDir", null);
string loadStr = String.Format("(vl-load-all \"{0}\") "/*space after closing paren!!!*/, lispPath);
curAcadDoc.SendCommand(loadStr);
}
Any help would be appreciated.
I believe I have to declare the namespace and also public class but I do not know how. Any example Please..
AcadDocument curAcadDoc = (AcadDocument)Autodesk.AutoCAD.ApplicationServices.Application .DocumentManager.MdiActiveDocument.GetAcadDocument(); curAcadDoc.SendCommand("(vl-load-com) "/*space after closing paren!!!*/); string lispPath = "C:LU.lsp"; string loadStr = String.Format("(vl-load-all \"{0}\") "/*space after closing paren!!!*/, lispPath); curAcadDoc.SendCommand(loadStr)
try with this