Jump to content

Recommended Posts

Posted
Lee, above lisp works fine here.

1-call up original block with attributes in new drawing

2- use Bedit to add one or more additional attributes

3- close Bedit window

4-enter attsync

5- Wblock revised block to overwrite original block

6- call up dwg with blocks to be updated

7- load and run ReDef

8-clap hands together !!!!!!!

 

Steve

It DID redefine the existing block? I could have sworn vla-insertblock wouldn't redefine. Learn something new every day.

  • Replies 29
  • Created
  • Last Reply

Top Posters In This Topic

  • alanjt

    9

  • dbroada

    7

  • Herewegoagain

    7

  • ReMark

    3

Top Posters In This Topic

Posted

sorry, I've been to bed while all this has been going on.

 

As Lee has said, you only need to redefine your block once and WBLOCK it to somewhere in your search path. Then you can insert that in to each drawing in turn. My script for doing this is something like.....

 

-insert
oldBlockName=
y
0,0
1
1
1
0
erase
l

qsave

 

as Alan has said, the = calls to insert an external copy of the block, not the one already in the drawing. The "y" is to accept the redefinition of the block. If you are doing this from the command line you can escape at this stage but I haven't found an easy way to send the escape character so I insert one copy of the block then erase it. If you are using an older version of AutoCAD you may need to zoom extents here. On old versions ERASE LAST would only erase the last visible object.

Posted

Hi guys,

Thanks for all your responses; it looks like what I want to do is certainly achievable but, because I know nothing of programming within CAD, and have only just heard about lisps and scripts, I am unsure how to apply the fixes you’re offering, any further explanations you could offer would be greatly appreciated.

Thanks yet again

Andy

Posted

the first thing to note is that you don't need to go to block edit on each drawing. Do it once and WBLOCK your new file somewhere. Then either insert that using the dialogue box and browse for the file or use the command line -INSERT and use the = method. That will save you some time in each drawing!

 

I still wouldn't want to do that 350 times though. A script is a text file that is read one line at a time and acts like you are typing the commands. I haven't got script pro or Lee's efforts so can't comment on what you need to do to construct ascript but just copy what I have put above into notepad and save it as "test.scr" (obviuosly use your block name). Open one of the drawings you want to change and either drag the script onto the drawing window or type SCRIPT and navigate to test.scr & ok. Then report back. :)

Posted

If you have non-LT AutoCAD, you can send LISP commands through a script file.

 

eg.

(command "_.-insert" "c:\\ALAN.dwg=" nil)
(command "_.attsync" "_N" "ALAN")

If loaded as an .scr, it could modify all desired drawings.

Posted
Alan, does that nil exit the command?

Yes.:)

That way you only insert the definition into the drawing (redefining if exists). No objects are created.

Posted

I'll try to remember that then - save me erasing last. :)

Posted
I'll try to remember that then - save me erasing last. :)

Definitely a little safer. :)

Posted

thanks for all your help everyone, I have been doing some reading, and think I'll be ready to have a play on Monday when I get into work, i'll let you know how I get on!!

Thanks again everyone!!

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