Tipster Dave Alexander shares a way to label items in your AutoCAD drawing on the appropriate layer without having to change layers.
"Make a toolbar or palette item that inserts a block or draws a new object and sets the correct layer for the item to a new layer that is based on the current layer. For example, heating pipe layer M-HOTW-PIPE-RETN-N is current. You need to put identification on the pipe, such as HWS. You set up a macro that checks the current layer and sets the new current layer by changing the minor group of the pipe layer M-HOTW-[PIPE]-RETN-N to M-HOTW-IDNT-RETN-N and setting it as the current layer. The pipe identification can be read from a separate file, or can be derived from the pipe layer name by selecting parts of it such as M-[H]OT[W]-PIPE-[R]ETN-N to set the pipe identification as HWR. The macro can insert the identification as a block of the same name or used as a variable for text or mtext.
"The really exciting thing is that by using this principle, you can make a LISP program that will allow you to make a selection set of multiple different entities on different layers and change them all from Existing layers to New layers, or Future, or Demolition. The other exciting thing is that you take AutoCAD out of the equation and allow the user to think in terms of mechanical systems, piping, pipe identification, and so on. New users do not have to decide what the pipe identification should be, only that the pipe needs to be identified."
Notes from Cadalyst Tip Reviewer Brian Benton: This tipster is using the National CAD Standards (NCS) from the United States as a layering example. The NCS has a method for creating layers: each part of the layer name means something. This tip uses that layer-naming convention to assist in creating new layers automatically with a LISP routine. Any layer standard can be used here, as long as your LISP routine is coded properly. If you can’t code in LISP you can also try creating labels in text, mleaders, or blocks. Put those labels in a tool palette, and edit them so that they automatically insert on a specific layer. |