About the Block and Attribute Replacement Conversion Tool

You can perform drawing-wide or project-wide block replacements using a user-defined Microsoft Excel spreadsheet and an AutoCAD Electrical toolset-aware symbol library that it references. The spreadsheet performs a lookup for each block name and finds the corresponding new block. Each new block drawing is pulled from the AutoCAD Electrical toolset symbol library and inserted (scaled and rotated as required) in the drawing. The spreadsheet is checked to copy the old attribute values to the appropriate new names on the newly inserted block. This process continues across the drawing, and terminates when no more block names remain. It automatically continues to the next drawing if project-wide mode is selected.

The mapping spreadsheet has two parts: Attribute mapping defaults and Block name mapping. Each section is a sheet within the spreadsheet and must follow a defined column format. The sheets must be in order, where sheet 1 defines the attribute mapping and sheet 2 defines the block mapping.

Attribute mapping defaults

General mapping of old attribute names to new attribute names so that the old values on the blocks can be copied to the swapped AutoCAD Electrical toolset-smart block.

Block name mapping

Maps existing specific or wild-carded block names to the new AutoCAD Electrical toolset block to use during the block instance swap. Each row of this spreadsheet is a mapping record for an old name to a new name swap.

The block replacement process generates a log file of the results. The log file ({projectname}_cnv.log) is created in the same folder as the .wdp project file. The following conditions are reported:

  • Problem finding/opening mapping spreadsheet
  • Problem inserting WD_M block (if not already present)
  • Legacy block name not mapped to an AutoCAD Electrical toolset block
  • AutoCAD Electrical toolset block not found in library search path
  • Problem inserting AutoCAD Electrical toolset block
  • Legacy attribute name not mapped

Attribute mapping sheet format

Column A / Old Attribute Name

Attribute tag found on the legacy, non-AutoCAD Electrical toolset block insert. Wildcards and AutoLISP-style punctuation for wildcards are supported.

Column B / AcadE Attribute Name

Attribute tag name found on the AutoCAD Electrical toolset block insert. Wildcards and AutoLISP-style punctuation for wildcards are supported.

Block name mapping sheet format

Column A / Old Block Name

Legacy, non-AutoCAD Electrical toolset block insert name. Wildcards and AutoLISP-style punctuation for wildcards are supported.

Column B / AcadE Block Name

AutoCAD Electrical toolset block name to use as a replacement for all instances of the block query match on columns A and C.

Column C / Filtering Expression

Optional. AutoLISP expression, or attribute definition, along with column A are what the program uses to query the table to find the correct mapping entry for a given block name to swap.

Column D/ Scale Multiplier

If blank, the new block swaps in at the same scale as the existing block it replaces. If this field is not blank, the swapped block is scaled up or down per the multiplier value of the field.

Column E / X-Y Offset

If blank, the new block swaps in at the same XY coordinate as the existing block it replaces. If not blank and in the format of a coordinate pair, the swapped block inserts offset from the origin of the original block by this XY amount.

Column F / Attribute name overrides

Defines specific attribute Old=New mapping that is not defined in sheet 1 or is to override what is found in sheet 1. Multiple entries in this field are supported with this syntax: Old1=New1;Old2=New2.

Column G / Attribute Value Overrides

Defines specific attribute values to insert into the newly swapped attributes. Multiple entries in this field are supported with this syntax: New1=val1;New2=val2. An entry of "New1=" blanks out that attribute value.