Extract attributes into a text file

Home tab > Symbol group >  Attributes menu > Extract attribute information, ATTEXTRACT

Read attribute information from objects and save them into a text file. Using template file user can define information to be extracted to a result file.

Result file can be imported to common database or spreadsheet programs for example Microsoft Excel.

Do the following:

  1. Enter template file name.
    Full file path shall be entered (for example C:\Own\CADMATIC\attextract_templatefile.txt).
    Entering '-character a file dialog is shown to help selecting template file.

  2. Enter result file name.
    Full file path shall be entered (for example C:\Own\CADMATIC\attextract_result.txt).

  3. Select CDF or SDF as a result file format.
     CDF: Fields are separated by a comma. Text fields are quoted. Each element is followed by an automatic line feed.
     SDF: Unformatted, template file shall contain all format information

Want to try?

Copy following template file example to a text file. Save it to disk and try this command how it works.

Template file

Based on template file information is extracted to external text file. Template file is textual file that defines what elements and how information is extracted.

Depending on element type following information can be extracted:

Result file detailed structure (not mandatory)

Each element can have separate format definition how information is extracted to file. Format definition shall be done if static text is needed alongside element information. Quoted format definition can contain statical text but also line feed (defined by \n) or tabulation (defined by \t).

In case that more detailed formatting is needed it shall be defined as follows:

"% + .decimals + field type"

Field type can be either i, r or s (where i=integer number, r=decimal number, s=text)

For example:

"%.1r\t"   (decimal number is always shown with 1 decimal, followed by tabulation)

"Symbol name is: %s\n"   (text will be for example "Symbol name is: MODEL" followed by line feed)

Template file examples

Template file row

Explanation

[LINE] Extract information on lines in drawing
:X0 "%.2r" Line start point X coordinate. For decimal number (r-character) two decimals is always shown.
:Y0 Line end point Y coordinate. Because no formatting is available all information (all decimals) is shown as it is.
:LAYER Layer name.

Template file row

Explanation

[SYMBOL]

Extract information on symbols in drawing

:NAME "Symbol name is %s\n"

Symbol name, s-character means text. Before symbol name text "Symbol name is" will be added. Line feed (\n character).

:ANGLE "Symbol angle is %.2r degrees "

Symbol angle. r-character means a decimal number and .2 means that number is shown with 2 decimals. Text line will be "Symbol angle is" followed by angle value and text "degrees".

:LAYER "and layer %s\n"

Symbol layer name (s-character) as text. Text line will be "and layer" followed by layer name. Line feed (\n character).

PRICE "Attribute PRICE is %s\n"

Symbol attribute PRICE name as text (s-character). Text line will be "Attribute PRICE is" followed by attribute value. Line feed (\n character).