Jump to content

Redefine block with script


eyde

Recommended Posts

I am writing a script to redefine the title block but am having some trouble with it.

The main problem is that when I wblock the new title block and use the block option Instead of picking the block itself there is no block in the new drawing.

If I wblock the title block itself then this is what I get

Command: -INSERT

Enter block name or [?]: "catalog web border=F:\Engineering\BORDERS\catalog web border.dwg"

Block "catalog web border" already exists. Redefine it? [Yes/No] : y

Block catalog web border references itself

Link to comment
Share on other sites

that is because you have a block called Block catalog web border within the drawing file Block catalog web border.dwg

I am getting confused by your use of WBLOCK. This is the way to write blocks to a file and nothing to do with inserting a file.

If I have to redefine a block I use the INSERT= method. This will allow the redefine from an external file.

I also insert the new border (so now I have the original border but redefined) plus a new instance of it. I then ERASE L(ast). I find this easier than escaping out of a script.

Link to comment
Share on other sites

Well I finally found out what was wrong. The wblock that I thought did not have a block in it actually has the definition in it. So I was able to write the script with no problem. What I did was open my new border.dwg and went into the block editor and wrote the block to a file. This exploded the block and just kept the definition.

blockreplace.scr

Link to comment
Share on other sites

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...