Setting Up Block Libraries

Translate

Contents

Related Links

 

Planning your block library

The first step in setting up a block library is to decide what you want in it.

Understanding the block library tree structure

The block library is a system that allows you quick access to a collection of blocks and commands that you set up. It offers a high level of flexibility and customization so that you may tailor the library to suit your needs. Each menu consists of 40 cells that can each be configured to do one of the following actions:

Each of these actions (except "do nothing") can be customized to fit your needs. Select an action above to see more on set-up and configuration.

When planning out the structure of your libraries it is sometimes helpful to think of it graphically.

Both the PLANBLKS and ELEVBLKS block libraries have a main menu that is comprised of 40 cells. Each of these cells can be configured to go to a submenu (the standard list of plan submenus is shown here - middle column).


PLANBLKS Main menu        Submenu1                             Submenu2                             Submenu3...

All submenus each have 40 cells in them. Each of these 40 cells can also be configured to go to submenus and so on. Of course not all of the cells have to be configured to go to submenus. (Typically not more than a few, if any, usually end up going to a submenu)

The standard block library tree is only one level deep but there is no reason yours can't go deeper. You may create as many levels as you need but keep in mind that the idea is to get to the blocks or commands as quickly as possible. We have found that one or two levels is usually enough, but do whatever works for you.

 

Laying out your menus

Many find that the easiest way to plan and layout your menus is to create the background drawings first so you can visually place your blocks and commands where they would go and configure their actions later.

To do this open the drawing that corresponds to the menu that you want to change and insert either copies of your blocks or create some sort of graphic to represent what you want each cell to do. For more on editing background images see "Changing the background image for a menu" from Customizing the Block Library System.

 

Back to top

 

Direct access to a specific block library menu

Sometimes going through the PLANBLKS' or ELEVBLKS' menu system takes too long, has too many steps, or one of the menus gets used so often that you feel you want a quicker more direct way to get there. To allow you to take a shortcut we have set up the block library system to give direct access to each of the menus created.

Examples of referencing block library menus directly are: the toolbar button for the architectural symbols ( ) and all of the references to block library menus in the "PLAN-Blks" and "ELEV-blks" pull-downs. Every menu created can be referenced directly without having to go through the PLANBLKS or ELEVBLKS main menus.

There are two ways to do this...

1. Set block library variables and then run the PLANBLKS or ELEVBLKS command.

This is the preferred method of calling a sub-menu directly. This requires you to type in more code than the second method but it has none of its drawbacks.

To use this method in a screen menu, pull-down, or for a toolbar you will need to enter the following:

For plan block menus:

(SETQ BLNDX_KLH# "APS-PB10" PBMAIN_KLH# "OFF" CELLID_KLH# "00");APS-PLANBLKS

For elevation block menus:

(SETQ BLNDX_KLH# "APS-EB10" EBMAIN_KLH# "OFF" CELLID_KLH# "00");APS-ELEVBLKS

If referenced in a LISP routine you would call it like:

(SETQ BLNDX_KLH# "APS-EB10" EBMAIN_KLH# "OFF" CELLID_KLH# "00")(C:APS-ELEVBLKS)

The only portion that you will change is the APS-EB10 portion. This is a code for which menu you would like to open and is described here:

APS-   This specifies that it is an APS-2008 menu that we wish to open.

EB   Whether the menu is set up in the Plan Blocks "PB" portion or the Elevation Blocks "EB" portion of the block library.

10   The number portion of the command name determined by the path to get to the menu. See below. It is a number (always two characters so the first cell would be 01) that represents the menu location, one set of numbers for each level down in the library.

Examples:  APS-PB would take you to the main plan block library.  APS-EB10 would take you to the first level sub-menu that is accessed from space 10 of the main elevation block's menu. APS-EB1032 would take you to the second level sub-menu that is accessed from pressing space 10 of the main menu and then space 32 of the second menu. The only limit to how deep you can go is your operating system and AutoCAD's restrictions on your filenames.

2. Reference the menu name

This way has less to type in but has two drawbacks:

  1. If you go to a sub-menu under the one referenced and then press <Space> or <Enter> to repeat what you just did, the first menu appears again and you have to select the space that goes to the sub-menu again to get to your item.
  2. If you would like to reference a sub-menu that is more than one level down in the library tree you will have to make sure the file is loaded prior to referencing it. The first level menu files are loaded automatically but any below are not - so APS-PB01 through APS-PB40 and APS-EB01 through APS-EB40 will load automatically if called but APS-PB0301 will not.

If you would like to use this method simply call the command name for the menu desired. This command name may be called from the command prompt, toolbars, or other commands as needed. The format for the command name is as follows:

APS-PB10_

APS-   This specifies that it is an APS-2008 menu that we wish to open.

EB   Whether the menu is set up in the Plan Blocks "PB" portion or the Elevation Blocks "EB" portion of the block library.

10   The number portion of the command name determined by the path to get to the menu. See below. It is a number (always two characters so the first cell would be 01) that represents the menu location, one set of numbers for each level down in the library.

_   Finally there is an underscore.

Examples:  APS-PB_ would take you to the main plan block library.  APS-EB10_ would take you to the first level sub-menu that is accessed from space 10 of the main menu. APS-EB1032_ would take you to the second level sub-menu that is accessed from pressing space 10 of the main menu and then space 32 of the second menu. The only limit to how deep you can go is your operating system and AutoCAD's restrictions on your filenames.

These command names can be entered at the command line just as shown above "APS-PB10_" or if referenced from a LISP routine you would call it like (C:APS-PB10_).

 

Determining the number portion of the command name

Each of the cells in a menu is numbered from 1 to 40. The example above has the number "10" and will bring up the menu that is located in the #10 cell of the main menu. This naming scheme goes as deep as your menus go. If you have created submenus below the second level the command naming is done by combining the numbers in the "path" to get to the menu.

Example: Let's take the command name "APS-PB401203_".


PLANBLKS Main menu        Submenu1                             Submenu2                             The "APS-PB401203_" menu

This would be the same as selecting cell #40 from the main plan blocks menu, when this submenu comes up then selecting cell #12, when this submenu comes up selecting cell #3 and the submenu that would then come up is the one that this command will bring up.

So running "APS-PB401203_" will get you to the same place as running PLANBLKS and then selecting cell #40, then cell #12, then cell #3.

Note: The command name must reference a submenu and not a command or block. If the numbers for the path don't go to a submenu it will not work.

These command names are created automatically when you create submenus while customizing block libraries.

Note: If you call a second level (or deeper) menu by using it's command name you will need to load the file before running it. All first level menu commands ("APS-PB01_" "APS-PB02_"... & "APS-EB01_" "APS-EB02_"...etc.) are set to "autoload" and do not have to be loaded prior to running them. Second level or deeper menu commands must first be loaded "(LOAD "APS-0232.LSP")" prior to running them. The filename of the menu file is the same as the command name but without the underscore at the end. If you don't want to worry about this you may also load the menu by setting block library variables and running either the PLANBLKS or ELEVBLKS commands see above.

Back to top

 


Is there anything that you find confusing or difficult? Please let us know so we can help!

© Copyright 2006 KLH Software, Inc. All rights reserved. Reproduction or copying of content or images is prohibited.
Legal Notices and Trademarks | Privacy Policy | Contact KLH Software
Autodesk, AutoCAD, AutoCAD Architectural Desktop, AutoLISP, and Visual LISP are either registered trademarks or trademarks of Autodesk, Inc., in the USA and/or other countries. All other brand names, product names, or trademarks belong to their respective holders.