Pallet Menus

Palettes are menu interfaces, built in HTML (Web page), to launch Autocad commands.
They have been developed to meet the following main needs: 1) To launch a graphical command efficiently, covering the minimum of the graphical screen. 2
) To be located on the network to facilitate maintenance and to ensure that everyone has the same interface, whatever the workstation.

3) be easy to maintain and independent of autocad versions

Loading a pallet

Command: SCDP "NomPalette

Or via the menu
PA_A01
PA_A02
(PA_A01) Allows to load standard palettes according to the type of work which one must carry out. It is generally necessary to load at least the "Basic Palette" or the "General Palette". For the others, it is according to your needs.
(PA_A02 ) Allows to load a specific palette developed for a particular need. The file explorer is used to load the desired palette.

Using the palette:

A palette opens in a window that has 3 possible states The interior of a palette is usually composed of a table and a cell. Clicking on the banner of a table switches the window between retracted and visible mode.
When you do this, the height of the window usually adjusts to hold all the tables.

The functions related to the right click are:
Using the menus to save and modify Cells, Tables and Palettes is actually not very interesting.
Often, the resulting HTML file destroys the HTML formatting (row changes, column alignment). It becomes less easy to resume by editor.
For modifications, if you have the possibilities, will be much more efficient and fast if you use an HTML editor to modify the original files which are in "MENUSNamePalette.HTM", as it is explained in the next chapter.

Programming an HTML palette and keywords:

A palette is actually an HTML file with certain tags and keywords that act on Autocad.
This chapter aims to describe the basics of how these palettes work so that developers can develop 'special applications'.
For modifications or adaptations of existing palettes, go to the next chapter

To benefit from the SCRIPTS of menu management, the declaration of HTML Styles and to be able to be loaded correctly, the HTML file must be of the form
<html> <head>
<meta http-equiv=
"Content-Language" content="en"> <title>Basic Table</title> <link
href="Palette.
css" rel="stylesheet" type="text/css"> <SCRIPT src="Palette.
src"></SCRIPT> </head> <BODY
ID="CMenuPalet
" style="margin:2px;" onload="InsertHTML();SendCommandArx('Loaded=');ReceiveCommandArx();" > ******** End of
head ********************** CONTENTS;TABLES
etc to be defined by yourself ***************** End
File By ******* <SCRIPT> InsertHTML
(); SendCommandArx
("Loaded="
+document.title); <
/SCRIPT>

 
To understand why these lines are there, we need to take apart the code in the "Palette.css" file.
A field "<INPUT ID='__CMDE__'...>" is used to pass commands to Autocad's ARX, and reciprocally, the ARX gives its answers in this Field.
For the rest, The content of the HTML page is free.
The Key Fields (in blue) allowing to communicate with Autocad are of the Form:
<DIV ID=CArx TITLE="Zoom Window max" VALUE="_zoom _a" HELP=LRA;ID_CONTENTS>ZMAX</DIV> Other ID's are also interpreted:
All other functionality is developed in JAVASCRIPT in the file 'Menu\Palette.SRC. This file is free, you can consult it.


Editing an existing palette (or copying):

Palettes are located in the '..\MENU' directory. If you need to create a new one, start from the copy of an existing palette.
With the help of a text editor or an HTML editor (Do not use Microsoft WORD or any other word processor) you will edit this file.
Be aware that a 'DIV' tag for example is an area of the file starting with '<DIV>' and ending with '</DIV>'. Tags can be nested.

1) Set the title and color of the closed palette, at the beginning of the file, in this SPAN tag:
<!--TCMD Square for color when closed --> <SPAN
id=Closed class=TableHead style=" background-color:#d0d0d0;"> BASE</SPAN>



2) Update the tables, rows and cells in the following form:
The italicized lines are those of the palette file; the others correspond to explanations.
<TABLE id=IdentifTable class="TableTheme"> TABLE = Beginning of table tag; IdentifTable is the identifier of this table<TR>
Beginning of ROW tag<TD id=Title title='
Title of my Example Table' HELP=PAL_PALETTES onclick="OnOff('IdentifTable',null);" colSpan=2>ExampleTable</TD> mmm</TR>
End of ROW tag<TR> 'TD' =
Beginning of
Celltag

; '/TD' = End of Cell tag 'TD0' = TD0 class for a
pinkbackground color. TD1:Yellow; TD2:Cyan;TD3:Grey:;TD4:Green;TD5:Purple. TD0G,TD1G...TD5G: Same color but in Bold.
These classes are defined in the 'palette.css' file
'CArx' is mandatory to link with Autocadtitle=
Contains the help title that will be displayed in the bar Windowsvalue=
Contains the Autocad commandThis
cell calls a 'ZExtend' image that will be displayed in the cell.
<TD class=TD0 id=CArx title='Title Cell 1,1, Zoom etendu' value="^C^C._zoom _ex"><IMG id=CArxI src="images/acad/ZExtend.bmp"></TD>
HELP=ACAD;LINE Calls up full help by right-clicking on this cell. This help calls the 'LINE' index of the Autocad help
<TD class=TD1 id=CArx title='Title Cell 1,2, Line' HELP=ACAD;LINE value="^C^Cline">Line</TD>
</TR>
<TR>
HELP=LRA;PAL_LOAD Call a full help by right clicking on this cell. This help calls the 'PAL_LOAD' index of the LRA.chm help.
LRA; is the default value and can be omi, (If PMS3D software, we have PMS3D.chm by default).
<TD class=TD2 id=CArx title='Title Cell 2,1, Load Palette' HELP=PAL_LOAD value="^C^CSCDP">Load Palette</TD> <TD class=TD3 id=CArx
title='Title Cell 2,2, Empty' ></TD> </TR> </TABLE> End of
TABLE tag

Somewhat more complex Palettes such as 'Page_vectorial.htm' and 'Page_PointCotés.htm' which use vector projects and layers can be used as a starting template.