.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Load my custom cui and unload default acad.cui

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
885 Views, 3 Replies

Load my custom cui and unload default acad.cui

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.
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

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.
Message 3 of 4
Anonymous
in reply to: Anonymous

Thank you very much!
Message 4 of 4
Anonymous
in reply to: Anonymous

Hi There,

I've got the same problem. Trying to solprof, which for as far as I know is not availible in VBA or VS(autocad), so SendStringToExecute is the answer.

Is there another way to use solprof, say recording a macro and then using it?. If yes How do i use this?

Regards,
J.Focke

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report