You can run commands synchronously using the
code from this file:
http://www.caddzone.com/CommandLine.cs
Use it like so:
{code}
CommandLine.Command( "._CUILOAD", "mycuifile" );
{code}
A general note to all regarding the above file: On x64 you
will need to revise the DLLIMPORT declarations to use the
64 bit EntryPoint signatures (they're not the same).
Use the x64 version of Depends.exe to get them.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com
Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm
wrote in message news:6138159@discussion.autodesk.com...
Hello! I found that I can load my cui file and unload acad.cui file using
next code {code} string mainCuiFile =
(string)Application.GetSystemVariable("MENUNAME"); mainCuiFile += ".cui";
cCurrent = new CustomizationSection(mainCuiFile); string sCuiName =
cCurrent.CUIFileBaseName; //Unload main cui
Application.SetSystemVariable("FILEDIA", 0); if (sCuiName != null &&
sCuiName.Length != 0)
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute(
"cuiunload " + sCuiName + " ", false, false, false); } //Set default
directory for my custom CUI file string sViViCuiFile =
"C:\\Users\\Alex\\AppData\\Roaming\\Autodesk\\AutoCAD
2009\\R17.2\\enu\\Support\\ViVi.cui"; cCurrent = new
CustomizationSection(sViViCuiFile);
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.SendStringToExecute(
"cuiload \"" + sViViCuiFile + "\" filedia 1 ", false, false, false); {code}
SendStringToExecute function executes asynchronous. Is there any other way
to do the same, but not using SendStringToExecute function.