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
(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
A Closed state or it has a size and position that you can set. The size and position can be adjusted as for a Windows window. According to the Windows theme chosen, it is more or less difficult to hang the corner. You have to approach it very slowly
A Visible Closed state which in reality corresponds to the closed state with a screen area of 20000 pixels. In this case, the functions are visible. We have a kind of Windows toolbar whose size can be adjusted
An open state which is triggered when you hover over the closed state. This state also has its own position and size that you can adjust to your liking. It is practical or even essential that the open state covers the closed state
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.
(PA_C01 ) To get to this HELP. (PA_C02 ) To reload the original file of this Help. This is useful when you modify the palette and want to check the result. (PA_C03 ) To load another palette in place of this one. (PA_C04 ) To save this palette to a file. Choose to save locally so as not to change the original palette
(PA_C11 ) To display the HELP related to this topic. This line appears only if a Help is connected (HELP=NomCHM;INDEX) (PA_C12)Classic Windows functions of copy and insert of complete tables.
(PA_C21 ) To reach the HELP for this cell. This line appears only if a HELP is connected (HELP=NomCHM;INDEX) (PA_C22) Classic Windows functions for copying and inserting cells. (PA_C23 ) Classic Windows functions for modifying cells. (PA_C24 ) Classic Windows functions for copying rows in a table
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>
ID=CArx CArx IDs are intercepted by the ARX and in particular the 'onclick()' to launch commands, 'onmouseover()' to display the title
TITLE= Titles are displayed in the Windows palette bar and in bubble info (Internet Explorer feature)
VALUE="_zoom _a" Contains the Autocad command to be executed. Command similar to the menu command.
HELP=[MomChm;]ID_CONTENTS To associate a helper with this tag (cell or table head). If no 'MyChm;' then the request will be made on the "PMS3D.CHM" or "LRA.CHM" file. It is possible to put the full path, otherwise the default path of the helper will be used. 'ID_CONTENTS' is an index found in the '.CHM' file. This Help is handled by the 'clickMenu()' function of javascript which launches the ARX command: SendCommandArx("HELP=MomChm;ID_CONTENTS");
Other ID's are also interpreted:
ID=CArx1,ID=CArx2 or ID=CArx3: They have exactly the same effect as ID=CARX. They allow you to differentiate HTML styles in order to have a different presentation.
ID=CArxI: Same as ID=CARX but taking the information from the parent element. Interesting to see for Images or icons embedded in cells. The command, the title and the image are in the cell, a click on the image launches the command of the cell.
ID=Select: This ID can only be put in a'<SELECT> ' tag The child tags<OPTIONS value=^C^Cvmaill></OPTION> contain the commands to be executed. The command will be that of the selected option.
ID=Projects: To select the Current vector project. See the "Vector_Page.htm" palette
ID=Applis: To select the Current vector application . See the palette "Vector_Page.htm"
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