I want to load a partial cui file using the "cuiload" command.When I run the following codes,I cannot load "MyCUI.cui".
string cuiFileName = @"C:\MyCUI.cui";
Tools.Document.SendStringToExecute(" filedia 0 " + "cuiload " + filename + " filedia 1 ", false, false, false);
But the following is OK:
string cuiFileName = "\"C:\\MyCUI.cui\"";
Tools.Document.SendStringToExecute(" filedia 0 " + "cuiload " + filename + " filedia 1 ", false, false, false);
And using "acedCmd" is wrong again:
[DllImport("acad.exe", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl, EntryPoint = "acedCmd")]
[CommandMethod("LoadCUI")]
public void saveCui()
{
string cuiFileName = "\"C:\\MyCUI.cui\"";
ResultBuffer rb = new ResultBuffer();
// RTSTR = 5005
rb.Add(new TypedValue(5005, "FILEDIA"));
rb.Add(new TypedValue(5005, "0"));
// start the insert command
acedCmd(rb.UnmanagedObject);
//CUILOAD
rb = new ResultBuffer();
rb.Add(new TypedValue(5005, "_CUILOAD"));
rb.Add(new TypedValue(5005, cuiFileName));
acedCmd(rb.UnmanagedObject);
//FILEDIA
rb = new ResultBuffer();
rb.Add(new TypedValue(5005, "FILEDIA"));
rb.Add(new TypedValue(5005, "1"));
acedCmd(rb.UnmanagedObject);
}
Can someone solve this problem?
Thanks in advance!