How to Extract Attribute Information in BricsCAD
Quick answer: ATTEXT copies attribute data to a text file via a dialog box, and -ATTEXT does the same via the Command line (this dialog-based version is a genuine addition to the attribute commands covered elsewhere in this hub, which only listed the Command line variant). The resulting file can be imported into a database or spreadsheet.
The Three Export Formats
- CDF (Comma Delimited Format): one line per block instance, attribute fields separated by commas, with character string fields enclosed in single quotes. Requires a template file.
- SDF (Space Delimited Format): one line per block instance, with each attribute field a fixed length and no separators or delimiters at all. Also requires a template file.
- DXF (Drawing Exchange Format): creates a subset of a standard DXF file (a
.dxxfile) containing everything about each block, insertion points, rotation angles, and attribute values. No template file needed.
Creating a Template File
CDF and SDF exports both require a template file first, an ASCII text file listing which attribute data fields get written, one field per line. BricsCAD recognizes 15 different fields, block name, the X, Y, and Z coordinates of its insertion point, its layer, and more; your template needs at least one attribute name included.
Each line follows a specific syntax:
- It starts with the field name. Block name and insertion-point fields must be preceded by
BL:. - The next non-blank character is either
C(a character string field) orN(a numeric field). - That’s followed by three digits giving the field’s width in characters.
- The final three digits give the number of decimal places for numeric fields; for character fields, these must be
000.
Extracting Attribute Information
- Open the Extract Attributes dialog: click the Extract Attributes tool button on the Tools toolbar, choose Extract Attributes from the Tools menu, or run
ATTEXTdirectly. - Click Select; the dialog closes temporarily.
- Select the blocks to extract from, then press Enter or right-click; the dialog reopens.
- Choose your text file format: DXF, CDF, or SDF.
- Select the template file (for CDF or SDF).
- Specify the output file’s name.
- Click Extract. BricsCAD reports how many records were extracted.
Frequently Asked Questions
Do all three export formats need a template file? No, only CDF and SDF do. DXF doesn’t require one.
What’s the difference between CDF and SDF formatting? CDF separates attribute fields with commas and wraps character strings in single quotes. SDF uses fixed-width fields instead, with no separators or delimiters at all.
What does the “BL:” prefix in a template file mean? It marks a line as referring to the block name or one of its insertion-point coordinates, rather than an attribute field.
How do I specify that a template field is numeric with two decimal places? Use N for the field type, followed by three digits for its width, then 002 for two decimal places, character fields always end in 000 instead.