Jump to content

update or insert blocks with attributes


serdas

Recommended Posts

Is it possible to have something that will help me to update my block information in each drawing without opening each drawing

I have over 100 drawing and I have a block on each of them, and has few attributes in the block and I need to change one or all of them. All will be same throughout the project.

 

 

Can you help me with this please?

Link to comment
Share on other sites

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

  • serdas

    12

  • dbroada

    7

  • nocturne00

    5

  • ReMark

    1

Top Posters In This Topic

You could try using a script file that opens the drawing, inserts the block, saves and closes the drawing. AutoDesk offers a utility called ScriptPro that makes running a script easier.

Link to comment
Share on other sites

when you say insert to a drawing do you mean it to be inserted in a specific location? is it an attributed title block you want to insert?

Link to comment
Share on other sites

yes it is. title block with 0,0 insertion point, i think i also have to fill the attributes as well or i can do copy with base point and paste.

 

can you sugest something?

 

thank you

Link to comment
Share on other sites

Sorry, never done it before. the only thing that comes to mind would be a LISP routine. but that would be some request to fill if someone in the forum would take interest on what you want to accomplish.

Link to comment
Share on other sites

when you say insert to a drawing do you mean it to be inserted in a specific location? is it an attributed title block you want to insert?

 

what did you have in mind

any suggestion is better then nothing

Link to comment
Share on other sites

A Lisp is a script.

All I can suggest is the long way of doing it one by one ^_^

nothing else comes to mind if you dont know how to understand and use a LISP

Link to comment
Share on other sites

A Lisp is a script.

All I can suggest is the long way of doing it one by one ^_^

nothing else comes to mind if you dont know how to understand and use a LISP

not strictly true - a script is a list of AutoCAD commands, particularly a list if often repeated commands. In this instanace it would be something like...

 

QNEW
-INSERT
TitleBlock
0,0
1
1
0
ASSEMBLY
FRED
123-456
SAVEAS
123-456

 

and would then repeat for each drawing being created.

 

We used to use DOS dir command then excel to build our drawing list and using excel Find|Replace build our scripts until I wrote a VB prog to do it.

 

I would suggest checking out ReMark's suggestion in this case.

Link to comment
Share on other sites

:oops: Thanks for the correction Dave.
:)

 

no worries.

 

scripts are very useful. As I implied above you can run them as a batch but you can run them individually in a drawing. A typical use might be if you have a set of drawings to do minor mods on and at the same time update the issue block. You can type your script in notepad, save it with a .scr extention. It could erase an area and then insert an exploded block @ 0,0. A little time spent with a piece of paper and notepad and each time you get to the update the issue block all you do is type SCRIPT, browse for your file and it all gets done.

 

AutoCAD has always had scripts but they are not well known. AutoCAD 2009 has made it more flexible and made a feature of it.

 

The one drawback of scripts is that it is just like sitting at the keyboard. There is no error trapping so an inappropriate reply from your script can send AutoCAD off in an entirely unexpected direction.

Link to comment
Share on other sites

Is it possible to have something that will help me to update my block information in each drawing without opening each drawing

I have over 100 drawing and I have a block on each of them, and has few attributes in the block and I need to change one or all of them. All will be same throughout the project.

 

 

Can you help me with this please?

back to the original question.

 

It is possible to do this without opening each drawing but I don't know how. What is possible is to have AutoCAD open the drawing and quickly issue a set of commands.

 

If you are after changing the value of an existing attribute the method is different to if you want to erase an existing block and replace it with a new one. In each case I would still use a script, which I have outlined above.

 

It is possible to run a single script on every file in a folder with a small batch file but I have never needed to do it this way.

 

This would also be possible using LISP but for simple tasks like this I would still script it.

Link to comment
Share on other sites

Big thanks for the Info, We also have several script files, mostly are for inserting linetypes, fonts etc. but we've never actually used them coz our predecesors just left in a snap and not even leaving a clue on how to use their scripts, lisps, TB's etc. :)

 

Could be very helpful to learn about this but may need to backtrack on Programming Basics to avoid screwing up

Link to comment
Share on other sites

It only needs patience and the better your understanding of basic AutoCAD commands the better. There are a couple of "gotchas", particularly when the question is asked differently between "live" and a script but in general the script should look identical to how you wouldtype on the command line.

 

If you have a script, print it out and type it in the commond line, line by line.

 

If you need a script step through on the command line and write each line on paper (or notepad) noting everything AutoCAD expects as an answer.

 

I have attached a simple script we create to batch plot some drawings. This has an odity in that I draw a line and imediately erase it. Why? Because usually AutoCAD thinks a print is a change to the drawing and asks if you want to discard changes but sometimes it doesn't. Putting in a line forces the question to be asked. Since I'm discarding all changes I needn't erase the line but never mind.

 

The resume is just something I now put at the end of all my scripts. Notepad sometimes puts a blank line at the end which AutoCAD interprets as "repeat last command". Resume is a sort of "do nothing" command so it doesn't matter if it gets repeated.

PLOT.SCR

Link to comment
Share on other sites

i will try to write one and post here to see if i did it right. one question though some of the commands i am very used to use icon example, to set a layer active i would go layer menager and set it active or open design center to bring a layer from the template and etc. how could i see the commands that autocadd using for those actions.

 

and i understand that it is not possible to update the block with scripts?

 

thank you for all your help

Link to comment
Share on other sites

sometimes you can press your icon then press F2 to see what command was active. If that doesn't help post your problem here and somebody should be able to help.

 

It is possible to update blocks by scripts but you do need to define excactly what you want to change. As I said above there are different approaches.

 

In the meantime, have a look at the -LAYER command.

Link to comment
Share on other sites

one more question

how can i insert a block using the comand line.

 

-insert only inserts tha block in the file but i need to get the block itself

 

thanks

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