MBLOCKREPLACE

Replace blocks (include dynamic blocks and anonymous blocks) by a name pattern, an Excel file or selection.

INTRODUCTION

In some bound drawings, drawings used FLATTEN command, and drawings converted from some programs outside of AutoCAD, such as Revit, there are copies of same block but with different block name, such as BLOCK001, BLOCK002, BLOCKnnn; or abc$0$BLOCK, xyz$0$BLOCK, etc. It takes a lot of time to replace them one by one. Sometimes these blocks are converted into anonymous blocks such as *U12, *U13, etc.

With MBLOCKREPLACE, you can enter a wildcard search criteria to select these blocks and replace them with a new block.

MBLOCKREPLACE can also transfer existing attribute values to new blocks.

Command: MBLOCKREPLACE
Select blocks by [File/Name/Select] <Name>:

Options:

    • File
      Select a CSV file and replace blocks according to the matching rules in the file.
      The matching rule format is: OLDBLOCKNAME,NEWBLOCKNAME
      You can input multiple lines to represent all rules.
      You can save an existing Excel file as a CSV file, remember to delete redundant columns and only keep 2 columns consist of old block names and new block names.
      Ensure all new blocks exist in current drawing before using MBLOCKREPLACE.

    • Name
      Enter search criteria with/without wildcard. For example, enter *$0$BLOCKNAME to select all blocks with $0$BLOCKNAME at the end of block name. Enter BLOCKNAME* to select all blocks with BLOCKNAME as the prefix.
      It selects all blocks with block name matching the searching criteria, including blocks in both modelspace and paperspace.
      To select anonymous blocks with star "*" in the name, use grave accent symbol "`" in front of "*", for example enter "`*U*" to select all anonymous blocks which name starts with "*U".
      It also searches all dynamic blocks matching the Block Name, regardless their Anonymous Names.
      It doesn't select nested blocks.
      It excludes array objects from the selection.

    • Select
      Select any block and replace them with the new one.

Delete original blocks? [Yes / No] <Yes>:

Select Yes to replace all selected blocks with the new block. Select No to remain them but still insert new blocks at insertion point of original blocks.

New blocks match original blocks' properties, including layer, color, scale and rotation individually.

Please pick up a new block:

Pick up one of the new blocks as a reference block and insert it at the insertion point of all selected blocks.

Reference block can be:

    • A normal block

    • A block with attributes

    • It prompts "Copy new attribute values or retain original values? Copy/<Retain>: ", usage as below.

    • A dynamic block

    • If the reference block has Linear Parameters, MBLOCKREPLACE will change new blocks' Linear Parameters to match original blocks' insertion scale.

    • An array object

Copy new attribute values or retain original values? Copy/<Retain>:

This option appears only when the reference block has attribute.
You can choose to copy attribute values of reference block to new block or retain attribute values of original blocks.
If Retain is selected, only when the attribute of original block has the same Attribute Tag Name as the reference block will retain their values.

TIPS

  1. Have a new block inserted in advance because it will use it as a reference block.

  2. It is very useful to replace multiple blocks in certain dwg file converted from Revit or AchiCAD.

  3. You can use "Copy" attribute options to copy attribute values of reference block to same named blocks in the drawing.

  4. Enter `*U* as search name will replace all anonymous blocks.

  5. It changes Linear Parameters of inserted dynamic blocks automatically based on the insertion scale of original blocks.

NOTES

  • Please check the layer status and ensure related layers are unlocked and thawn.

  • Array objects will be excluded from the selection set but can be used as reference block.

TRIAL VERSION LIMITS

  • In trial version, only 5 blocks in the selection set can be replaced.

Please contact liugesen@126.com to get a free Registration Code.

DISCUSSIONS

UPDATES

25/08/2020, Fixed a bug when replace mirrored uniform-scaled blocks.
01/02/2020, Fixed a bug when using "File" option.
21/06/2018, Exclude array object from selection set.
Change Linear Parameters of inserted dynamic blocks automatically based on original block insertion scale.
14/06/2018, Provide new option to copy new attribute value or retain original value.
Able to replace dynamic blocks / anonymous blocks
25/04/2016, Added an option to read a csv file and replace blocks to its matching rules.
17/08/2013, Added an option to delete or retain the original blocks.
08/08/2013, uploaded.