top of page

ِAutocad/Learning/Important Points

Block/Attribute

How do I control the prompt order for attributes?

When building the block definition, the selection order is the key.  If you simply window off the geometry there is a good possibility the prompt order will not be as desired.  When selecting objects for a block definition, first individually pick the attribute definitions individually in the order you want to be prompted, then select the rest of the geometry.

Importing Block Definitions

If you want to bring in only the definition of a block (such as a symbol on disk), you can use this little known trick.  After issuing the insert command and selecting the file, press the ESC key at the first (insertion point) prompt.  You will have the definition in the current drawing for latter use.

Add Descriptions to Blocks

Later versions of AutoCAD have the ability to add descriptions to the block definitions in the drawing.

  • Issue the BLOCK command.

  • Select the block from the list at top.

  • Click in the lower 'Description' section and enter the description.

  • Choose OK to redefine the block with the new description.

Building a block with fields (2006+)

This procedure will explain how to create a coordinate label block that updates as you move or copy it.

  • Issue the BEDIT (block edit) command.

  • Enter the desired name, like COORDBLOCK and chose OK.

  • Draw the desired point identifying geometry, such as a circle at 0,0 with a radius of 0.25.

  • Issue the ATTDEF command.

  • Turn on the Preset toggle in the upper left, this makes for faster inserts as AutoCAD won't prompt for the attribute values (which is automatic anyway).

  • Enter NORTHING for the tag and prompt fields.

  • To the right of the Value field, click the 'Insert Field' button.

  • In the Field Names list on the left, click 'BlockPlaceholder', this is a special area only available during block building.

  • In the middle column, choose the 'Position' property.

  • In the right column, format your output as desired. In this example turn off the X & Z fields and 'Current Units' is the recommended value. While you can lock the precision to a fixed number of places, it's not easy to modify a field based attribute later.

  • Choose OK after completing the field formatting.

  • Change 'Text Options' as desired. For this example we are only changing the height to 1.0.

  • Most likely you will want to turn off the 'Lock Position' toggle so you can move the attribute after the insert.

  • Choose OK to complete the first attribute. When prompted for the insertion point, pick a location or enter coordinates such as 1.0,1.2 for this example.

  • Repeat at step 5 for the EASTING & ELEVATION field attributes, the only other difference being that the 'Align below previous' toggle should be turned on to make positioning easier.

  • Issue the BCLOSE command or choose the 'Close Block Editor' button at the top.

  • Choose Yes to save the changes.

At this point the COORDBLOCK is defined and ready to insert. As you insert them into the drawing the coordinates are filled in automatically. After moving an insert issue the REGEN command to update the values.  To make the block available for inserting into other drawings, it will need to be WBLOCKED to a separate DWG file.

  • Issue the WBLOCK command.

  • Choose the Block button and select COORDBLOCK in the list.

  • Click the [...] in lower right to specify a filename.

  • Changing the Insert Units to 'Unitless' is recommended.

Adding Attributes to Blocks

To add an attribute to a block that's already defined (and used) in the drawing, simply issue the BEDIT command, select the block defined and use the ATTDEF command. It's likely you will want to turn on the "Align below previous attribute definition" toggle. Then close the Block Editor and Save Changes.

The most important consideration now is that existing inserts don't have a placeholder for your new attribute! AutoCAD's built in ATTSYNC command can correct this. Issue the command, press enter to <Select> and pick any insert of your block, press enter to confirm. All the instances of your insert now display the newly added attribute with the default value. You can now simply double-click an insert to change the value in the enhanced attribute editor.

Block Base

When designing blocks, it's always best to create the geometry centered around the origin of 0,0. Sometimes users can create a block from geometry in model space and it ends up difficult to use when inserting the block.

To correct this, issue the BEDIT command, select the misbehaving block, then use the move command to move the block elements to 0,0. You may need to use a specific base point (such as the midpoint of a feature) to 0,0.

Block Geometry Properties

The component geometry used to create blocks should be created with a layer of 0, and other properties (especially color) set to a BYBLOCK setting. That way it will take on the properties of the layer it's inserted onto, or the specific properties you specify in the properties dialog.

Failure to do this can mean confusion. For example if you create your block geometry on layer BLOCKGEOM, then insert them on a layer like INSERTS, you will find that layer INSERTS cannot be purged, even though there are no visible objects (when the layer BLOCKGEOM is frozen). In this case the invisible insertion point prevents the layer purging.

Cloning Blocks

You can use AutoCAD's Block Editor to create copies of a block. Simply issue the BEDIT command, choose the source block, then use the Block Editors 'Save Block As' icon and designate the new name.

Fields

Using FIELDS

AutoCAD FIELDS are extremely useful. In previous newsletters we have discussed some of the more complex uses, such as in block attributes.  However, you can easily use them at the command prompt with the FIELD command. Here is an example of an auto updating plot stamp.

  • Enter the FIELD command.

  • Scroll down the list on the left and select PlotDate.

  • Choose the way you want the date to appear in the center.

  • Choose the [OK] button to place the field in the drawing.

  • Complete placement which is similar to the Mtext command.

Note that initially, this field will appear as four dashes, but it will be automatically updated by AutoCAD every time you plot!  Take a few minutes to review some of the other field names on the left, the use of fields can greatly expand the capabilities of your drawings!

Layers

Why isn't my layer table sorted?

If you begin working with a large number of layers (around 200), you may notice that the layers are not sorted in the layer dialog. Instead they are shown in the order they were created. AutoCAD uses a system variable MAXSORT to control how many layers to sort on layer control as well as how many files to sort on file open. Simply type in MAXSORT at the command prompt and put in a numeric value larger than the default value of 200. This value is stored in the configuration files and won't need to be reentered in your next drawing.

Don�t Plot That Layer!

A trick in AutoCAD that has been around for the longest time is a layer name that won't plot regardless of its status. Create a layer in your drawing called DEFPOINTS. Use it to place notes to yourself, construction lines, etc. It also an excellent layer to put paper space viewports into, since the frames don't plot.

No Xref Layer Filter

If you want your layer dialog to show only layers in the current drawing and exclude all xrefs, create a filter with a name like NOXREF, then put this in for the layer name "~*|*" (without the quotation marks).

Delete All Named Layer Filters

Later versions of AutoCAD have the ability to delete all named layer filters quickly.

  • Open the Layer dialog box.

  • Open the Named Layer Filters dialog using the [...] button in the upper left corner.

  • Choose the [Delete All] button in the lower right.

Copy Layer Table

Beginning with AutoCAD 2005, you can copy the contents of the layer dialog to the clipboard for pasting into other applications, mainly for printing. With the dialog displayed, issue the Ctrl+A keystroke combination to select all the records, then use Ctrl+C to copy the contents to the clipboard.

New Layers (Frozen in Existing Viewports)

Starting with AutoCAD 2008, the layer dialog has a new icon just to the right of the 'New Layer' icon. Use it to create a new layer that will be frozen in all existing layout viewports!

Another Classic - ClassicLayer

Some users of newer versions of AutoCAD are reporting slow behavior in using the new Layer dialog that floats and remains open. This new dialog must constantly monitor AutoCAD to maintain an accurate reflection of the layer status in the drawing, including reacting to changing the active drawing, etc.

For those who want faster response or those that like the old way better, use the ClassicLayer command to initiate the old dialog.

Layer Properties Manager

If you need to make changes to all (or most) layers in a drawing, with this dialog displayed press Ctrl+A (or right click and choose Select All), then click the operation. For example, if you click the linetype (or other) fields you are making changes to all selected items in the list.

If there are items you wish to exclude hold Ctrl while clicking to deselect them.

An extra tip along these lines. You can press Ctrl+C to copy the properties of the selected rows to the clipboard, ready to paste into other applications like MS Excel, etc.

Customization

Using the Startup Suite

Users often come across usable code they want to add to their systems but don't know how to proceed. You may obtain a file with the extension LSP, VLX, DVB, etc.  Another case is lisp code in the form of text on a newsgroup or web page.  In this case we need to get it into a file with this first procedure.

Inline LSP Code to File

  • Highlight the text in the source window (email, newsgroup reader).

  • Right click and choose Copy.

  • Open a Notepad or any pure ASCII editor.

  • Right click and choose Paste.

  • Choose File > Save As.

  • Choose an appropriate folder and enter the name "FILENAME.LSP" including the quotation marks. Otherwise Notepad will name the file FILENAME.LSP.TXT, which won't work.

Also, it's highly recommended that you create a dedicated folder (like C:\CADSTUFF) to place these files. If you place them in the AutoCAD folder they may be removed if you upgrade/reinstall.

Adding functions to Startup

  • Command: APPLOAD

  • Choose the (Contents) button in the Startup Suite.

  • Choose the (Add) button, then browse to the location of the code file and select it.

  • Choose the (Close) button to close the Startup Suite.

  • Choose the (Close) button to close the Appload Dialog.

From this point forward, the commands defined in these code files should be available in future sessions without needing to load them each time.

CUI Unresolved Files

On starting the CUI command you may receive alerts about unresolved files that can no longer be found. To clean these up, expand the 'Partial Customization Files' section and look along the list for items with an (Unresolved) suffix. If you can't resolve the item, right click and choose 'Unload'.

bottom of page