Jump to content

Recommended Posts

Posted

I am trying to write a macro script to rename ( dozens ) of blocks in dozens of files.

 

It is working fine except for one block which has a gap in it's name. The script stops running when it comes to it.

 

-rename;;b;A2-1 EE;EVAC11;;b;a2-2-EEO;EVAC12;;b;a2-3-EEDNB;EVAC13

 

This is a cut / patch paste - the problem block is highlighted red i.e. block named A2-1 EE.

 

AutoCAD rips through all the blocks in the script which come before it ( which I have not pasted up here ) and stops stating "cannot find block named A2-1".

 

The script does not "like" the gap in the blockname.

 

I have a simple workaround for now - take this block out of the script and deal with it manually in each file.

 

Is there any way to fix the script however i.e. make AutoCAD see the full blockname , gap and all ?

Posted

To be able to use names with spaces in script files you need to enclose them in quotes:

"A2-1 EE"

Posted

Thanks but now I'm getting

Cannot find block " "A2-1"
Posted

Seems that you missed to enclosed in quotes the entire name.

"A2-1 [color=red]EE[/color]"

Posted

Glad to hear that is solved now. You're welcome!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...