home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 168.img / ACAD3.ZIP / MC.DOC < prev    next >
Text File  |  1988-07-28  |  5KB  |  120 lines

  1.                         AutoCAD Menu Compiler
  2.  
  3.                          by Kelvin R. Throop
  4.                     Revision 2 --  October 22, 1985
  5.  
  6. The AutoCAD menu compiler makes the previously tedious and error prone
  7. task of constructing tablet menus merely boring and unforgiving.  It
  8. eliminates the need to duplicate text in many locations when using
  9. "large boxes" on a tablet, and removes the need to count lines by hand
  10. when placing information in a menu file.  In addition, a powerful
  11. macro facility is provided which allows commonly used substrings to be
  12. expanded automatically.  This facility makes configurable menus
  13. possible and reduces retyping.  The output of the menu compiler is a
  14. .MNU file compatible with AutoCAD 2.0 and up.
  15.  
  16. USING THE MENU COMPILER
  17.  
  18. The menu compiler is invoked with the command:
  19.  
  20.     MC <file> [options]
  21.  
  22. where <file> is the name of the menu definition file to be processed,
  23. specified without the file type.  The input menu definition file
  24. should have a file type of ".MND", and the output menu will be written
  25. with file type ".MNU", overwriting any previous file with this name.
  26. Options are specified as "-<letter>", and are as follows:
  27.  
  28.     -D     Dump macro definitions
  29.     -I     List input
  30.     -M     Disable macro facility
  31.     -?     Print a help message
  32.  
  33. THE MENU DEFINITION FILE
  34.  
  35. An AutoCAD menu is composed of sections, such as "TABLET1", "BUTTONS",
  36. and "SCREEN", and user-defined submenus.  The menu definition file is
  37. a compact form of specifying a menu file.  If none of the features
  38. provided by the menu compiler are used, the output file will be
  39. identical to the input.  You may run the AutoCAD standard menu through
  40. the menu compiler to prove this to yourself.
  41.  
  42. There are two major features offered by the menu compiler: multiple
  43. line items and macros.  These features are completely separate and
  44. will be discussed separately.
  45.  
  46. Multiple Line Items
  47.  
  48. In a tablet menu, large boxes are frequently used to invoke commonly
  49. used commands.  A large box is actually made of up several smaller
  50. boxes.  AutoCAD doesn't "know" about this large box as a separate
  51. item--the large box is implemented simply by duplicating the menu
  52. command text in each of the smaller boxes which make up the large box.
  53. Before the menu compiler, this meant placing the command lines in
  54. multiple places in the file, counting lines from the start of the
  55. section by hand.  Now you can say:
  56.  
  57.     <number,number,...>Command
  58.  
  59. and the "Command" will be placed automatically at the specified lines
  60. in the file.  For example, if the REDRAW command is to be placed in
  61. boxes 20, 21, 22, 98, 99, 100, 141, 142, 143 in the menu, you would
  62. say:
  63.  
  64.     <20,21,22,98,99,100,141,142,143>REDRAW
  65.  
  66. and the menu compiler will automatically place REDRAW on each of the
  67. specified lines of the section.  You may use regular commands within
  68. one section (for a screen menu, say), and multiple line commands
  69. within another.  Mixing command types within a section is probably an
  70. error and will generate a diagnostic from the menu compiler.  To place
  71. text on a single line, just specify one number before it:
  72.  
  73.     <33>QUIT
  74.  
  75. Macros
  76.  
  77. The menu compiler allows commonly used text to be stored in macros and
  78. inserted by name at any place within the menu.  To define a macro, use
  79. a command of the form:
  80.  
  81.     {macname}=text
  82.  
  83. where "macname" is the name of the macro (1 to 31 characters, case
  84. insensitive) and "text" is the text value of the macro.  The macro
  85. definition must start in column 1 of the line.  A macro may be invoked
  86. anywhere within the text just by naming it within braces.  For
  87. example, if you have defined:
  88.  
  89.     {animal1}=cat
  90.     {animal2}=rat
  91.  
  92. the text line:
  93.  
  94.     <12,35>The {animal1} saw the {animal2}.
  95.  
  96. will place the command "The cat saw the rat." on lines 12 and 35 of
  97. the section.
  98.  
  99. A macro definition cannot span more than one line.  Maximum line length
  100. is 132 characters.
  101.  
  102. Macros may be used recursively.  For example, you may define:
  103.  
  104.     {default}=LAYER SET 0  COLOR BYLAYER LINETYPE SET BYLAYER  SNAP .25
  105.     {reset}=ZOOM A {default} GRID ON
  106.  
  107. and then say:
  108.  
  109.     <1,2,13,14>{reset} SAVE
  110.  
  111. If you create an infinite recursion loop, the menu compiler will give
  112. up after the menu item grows to more than 900 characters, issue a
  113. diagnostic, and replace the offending line in the output menu with a
  114. line which indicates which macro was being evaluated when the cow fell
  115. through the roof.
  116.  
  117. If you have information within braces and don't want the macro
  118. expansion to process it, you may disable macro expansion altogether by
  119. setting the -M switch on the command line.
  120.