Extracting BlockAttributes to a Text File
The ExtractBlockAttribute command lets you extract BlockAttribute values to text files of various formats.
Template files define the data to extract.
You can examine the extracted data using spreadsheet software or other applications.
To extract BlockAttributes to a text file:
- Type ExtractBlockAttribute at the command prompt.
- In the dialog box, for Template, type a template name to define the data to extract. Click
to browse for a file.
See Creating Template Files for BlockAttribute Extractions for information about the file syntax.
- Click Select Entities
to specify the entities for extracting BlockAttribute data.
The dialog box closes temporarily.
- In the graphics area, select Blocks with BlockAttributes and press Enter.
- In the dialog box, for Output, type the location and name of the output file. Click
to select a file name.
- In Format, select the file format to use when writing the BlockAttributes information:
- Comma Delimited File (CDF). Commas separate the fields of each BlockAttribute record. Strings are enclosed by single quotation marks.
- Space Delimited File (SDF). Spaces separate the fields of each BlockAttribute record. Strings are enclosed by single quotation marks.
- Click OK.
Creating Template Files for BlockAttribute Extractions
Template files for BlockAttribute extractions define the data fields to extract and control the format in which they appear.
Use an ASCII text editor to create a template file for BlockAttribute Extractions.
Each line in the template file:
- Specifies the BlockAttributes and the Block properties to extract.
- Must use a specific syntax described below.
- Becomes a column in the resulting output file (see example).
You must include at least one BlockAttribute name in a template file.
File Syntax
Each line in the template file uses the following syntax:
field_name [space(s)] output_format
Valid field names are shown in the Extraction Field Names table below.
One or more spaces separate field_name and output_format. Use spaces, no tabs. End each line by pressing Enter, including the last line.
The output format uses the following syntax:
Twwwppp
The data type (T) can be:
C |
Indicates a character string field. |
N |
Indicates a numeric field. |
The next two portions of the output format use three digits:
www |
Width |
Specifies the width of the field as a number of characters. |
ppp |
Precision |
Specifies the number of decimal places for numeric fields.
For character integer fields, specify 000. |
For example,
- Use N006002 for a numeric value up to 999.99. N stands for numeric data, 006 means that there is space for up to six digits, including the decimal point, and 002 specifies the precision of two decimal places.
- Use C025000 for a string field with a maximum length of 25 characters. Always specify 000 as the last three format digits for character fields.
Table: Extraction Field Names
You can extract:
- The value of BlockAttributes of Blocks inserted into the drawing.
- Predefined properties of the Block to which the BlockAttribute belongs.
Use the following extraction field names and format specifications to extract relevant data:
Field Name |
Format |
Extracts |
BlockAttribute name |
Cwww000, or Nwwwppp |
BlockAttribute value |
BL:NAME |
Cwww000 |
Block name |
BL:X |
Nwwwppp |
X coordinate of Block insertion point |
BL:Y |
Nwwwppp |
Y coordinate of Block insertion point |
BL:Z |
Nwwwppp |
Z coordinate of Block insertion point |
BL:ORIENT |
Nwwwppp |
Block rotation angle |
BL:XSCALE |
Nwwwppp |
X scale factor for Block |
BL:YSCALE |
Nwwwppp |
Y scale factor for Block |
BL:ZSCALE |
Nwwwppp |
Z scale factor for Block |
BL:XEXTRUDE |
Nwwwppp |
Block extrusion in X direction |
BL:YEXTRUDE |
Nwwwppp |
Block extrusion in Y direction |
BL:ZEXTRUDE |
Nwwwppp |
Block extrusion in Z direction |
BL:LAYER |
Cwww000 |
Block insertion Layer name |
BL:HANDLE |
Cwww000 |
Block handle |
BL:NUMBER |
Nwww000 |
Block counter |
BL:LEVEL |
Nwww000 |
Block nesting level |
Example
Template file:
BUILDINGTYPE C030000
ZONENAME C025000
ACTIVITY C020000
HVACSYSTEM C025000
AREA N006002
HEIGHT N004002
BL:NAME C012000
BL:NUMBER N002000
Output file (.cdf format):
'Workshops/maintenance depot','Z0/09 Staff Room','Eating/drinking area','Underfloor Heating',31.79,2.55,'ZONE',1
'Workshops/maintenance depot','Z0/14 Plant Room','Plant room','Zone without HVAC system',15.84,4.10,'ZONE',2
'Warehouse and storage','ZO/11 Lobby','Storage area','Space Heating',53.26,4.10,'ZONE',3
...
Command: ExtractBlockAttribute