Tuesday, December 12, 2006

Want to count some Blocks? Then eat Text.

Use the AutoCAD Enhanced Attribute Extraction wizard to count Blocks in your drawings and neatly display them in an AutoCAD Table. Don't let the name fool you, you can use this wizard to count even Blocks that have no attributes.

Run the EATTEXT command or choose Tools > Attribute Extraction... to begin the wizard which consists of six pages of dialogs. On the first page you choose to create a Table from scratch or you can reuse settings that you've previously saved.

The second page of the wizard allows you to choose the drawings from which to count Blocks. You can limit the count to a specific selection set, the current drawing, select multiple drawings or even an entire sheet set. The Additional Settings... button allows you to control whether externally referenced, nested, or paper space Blocks are included in the count.

The third page of the wizard lists all Blocks in the selected drawings. Here you can elect to exclude Blocks that have no attributes, or exclude/include specific Blocks. Use right-click to Check All/Uncheck All or edit the Display Name of the desired Attributes or Block properties (this is the value that is displayed in the resultant Table).
The fourth page of the wizard is a preview of the Table to be created and a summation of the selected Blocks. Right-click on the column headings to rename, rearrange, sort, filter, or hide columns. Drag the column heading buttons to change their order. You also choose the output type on this page. The output can be to an AutoCAD Table and/or a comma delimited text file (suitable for Excel).The fifth page allows you to choose the Table Style to use when placing your Table. You want to edit your Table's appearance here; do not edit the Table itself. Manual edits to the Table are discarded when the Table is updated. That's right, this Table is linked to the selected Blocks and can be updated to reflect changes to the Blocks!

The last page of the wizard gives you the opportunity to save all the settings from the previous five pages as a template for use in performing this same extraction again in other drawings at other times.

When you finally OK the last page of the wizard you're prompted for an insertion point for your Table. It's good practice to always place the Table in Paper Space.

Right-click on the Table at anytime and choose Update Table to refresh the Table or edit the extraction settings. (Remember manual edits will be discarded on update.) Depending on your AutoCAD settings you're notified with a balloon in your tool tray when drawing changes necessitate refreshing your Table.

How good are these extracted Attributes and Block counts? Only as good as your drawing. Exploded blocks won't be counted and Attributes that weren't filled in correctly won't display the correct information.

Tuesday, December 05, 2006

Repath an Xref

Have you ever opened a drawing and found that an Xref failed to load because it was moved or renamed on the network? You dutifully pick up the phone and ask the Project CAD Coordinator what's going on, and they tell you that the original background was not named according to standards, and that they've "fixed" the issue. So you detach the missing Xref that has the old name, then re-attach the correctly named background. Now you have to reset all the Xref Layer properties again: Freeze/Thaw state, Color, etc.

Try this instead: repath the existing Xref attachment (or overlay) to the new name. Open the Xref dialog, select the missing Xref, and Browse to its new name/location. This way you preserve all your previous modifications to the reference's layers.

AutoCAD 2006 and previous (or using the CLASSICXREF command in AutoCAD 2007):

AutoCAD 2007:

Now your Xref name may not match the name of the file you browsed to, but you can easily fix that with the RENAME command, or by hitting F2 when the Xref is selected in the Xref dialog. This same methodology works for repathing/renaming Images too.