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

Unknown Command on Autocad Startup

5 REPLIES 5
Reply
Message 1 of 6
aslam
805 Views, 5 Replies

Unknown Command on Autocad Startup

Hello All,
Using c# i have created a palette. I start the autocad and netload the dll and run this project. Then i close the Autocad without closing palette. Next time whenever i start autocad, at command prompt it shows "xxx" (related to palette) Unknow command , press f1 for help.

Means before netload autocad searches for last opened palette and it could not found that. After I netload and choose dll it is working properly.

any Help???
5 REPLIES 5
Message 2 of 6
Anonymous
in reply to: aslam

AutoCAD tries to restore palettes that were visible
when it was last closed.

To do that, it executes the command that you give
in the call to create the paletteset, which must be
avaialble at startup.

That means you must register your command in the
Applications subkey in the registry, to demand-load
your assembly the first time the command is issued,
or to have the assembly loaded at startup.

Search this newsgroup for information on how to
register your command/assembly, and you should
find some helpful information and samples.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5538056@discussion.autodesk.com...
Hello All,
Using c# i have created a palette. I start the autocad and netload the dll and run this project. Then i close the Autocad without closing palette. Next time whenever i start autocad, at command prompt it shows "xxx" (related to palette) Unknow command , press f1 for help.

Means before netload autocad searches for last opened palette and it could not found that. After I netload and choose dll it is working properly.

any Help???
Message 3 of 6
aslam
in reply to: aslam

Thanks Tony. That is exactly the problem.
I am giving you more details about it , plz guide me why this message coming and what should i do to solve this.

//Main Method
[CommandMethod("Alex")]
public static void Alex()
{
//Here I created Two Palettes
p1 = new PaletteSet("Alex",new Guid(.......))
p2 = new PaletteSet("My Files", new Guid(......))


}

Questions:-
1. Now whenever i start autocad It shows
Unknow command "ALEX"
Unknow command "My"
Unknow command "Files"

Why this "Three" messages coming.

2. Now which command should i regiester as you told me before?

Thanks...
Message 4 of 6
Anonymous
in reply to: aslam

The first argument to the constructor is not the
'Name' of the palette set, it is the name of the
command that is used to activate the pallete set,
so your first call is correct, because the string is
the same as the command name.

You have to register your command to load your
assembly the first time the command is issued.

Search this newsgroup for more info on doing that.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5538139@discussion.autodesk.com...
Thanks Tony. That is exactly the problem.
I am giving you more details about it , plz guide me why this message coming and what should i do to solve this.

//Main Method
[CommandMethod("Alex")]
public static void Alex()
{
//Here I created Two Palettes
p1 = new PaletteSet("Alex",new Guid(.......))
p2 = new PaletteSet("My Files", new Guid(......))


}

Questions:-
1. Now whenever i start autocad It shows
Unknow command "ALEX"
Unknow command "My"
Unknow command "Files"

Why this "Three" messages coming.

2. Now which command should i regiester as you told me before?

Thanks...
Message 5 of 6
aslam
in reply to: aslam

Hi Tony,
Thanks for your help.
I solved my problem by an alternate.

p1 = new PaletteSet("",new GUID("..."));
p1.Name="Alex";

p2=new PaletteSet("",new GUID("...."));
p2.Name="File Results";

Thanks....
Message 6 of 6
Anonymous
in reply to: aslam

It doesn't work in my project.why?
Is there any thing wrong?
psExplorer = new Autodesk.AutoCAD.Windows.PaletteSet("", new Guid("63B8DB5B-10E4-4924-B8A2-A9CF9158D4F2"));
psExplorer.Name = "Explorer";
psExplorer.Load += new Autodesk.AutoCAD.Windows.PalettePersistEventHandler(psExplorer_Load);
psExplorer.Save += new Autodesk.AutoCAD.Windows.PalettePersistEventHandler(psExplorer_Save);
psExplorer.Style = Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowPropertiesMenu | Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowAutoHideButton | Autodesk.AutoCAD.Windows.PaletteSetStyles.NameEditable | Autodesk.AutoCAD.Windows.PaletteSetStyles.UsePaletteNameAsTitleForSingle | Autodesk.AutoCAD.Windows.PaletteSetStyles.Snappable;// Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowCloseButton;
psExplorer.MinimumSize = new System.Drawing.Size(200, 300);
psExplorer.Add("SmartSoft.ACADTools", new Workbench());
//psExplorer.DockEnabled = Autodesk.AutoCAD.Windows.DockSides.None;
psExplorer.Dock = Autodesk.AutoCAD.Windows.DockSides.Left;

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost