serdas Posted November 5, 2008 Share Posted November 5, 2008 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? Quote Link to comment Share on other sites More sharing options...
serdas Posted November 5, 2008 Author Share Posted November 5, 2008 i have a block with attributes and have to insert them more then 100 dwg. is there a easy way to do this thank you Quote Link to comment Share on other sites More sharing options...
ReMark Posted November 5, 2008 Share Posted November 5, 2008 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. Quote Link to comment Share on other sites More sharing options...
serdas Posted November 5, 2008 Author Share Posted November 5, 2008 I have no idea about scripts. can you help me more with htis? also can it delete a block as well thank you Quote Link to comment Share on other sites More sharing options...
nocturne00 Posted November 6, 2008 Share Posted November 6, 2008 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? Quote Link to comment Share on other sites More sharing options...
serdas Posted November 6, 2008 Author Share Posted November 6, 2008 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 Quote Link to comment Share on other sites More sharing options...
nocturne00 Posted November 6, 2008 Share Posted November 6, 2008 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. Quote Link to comment Share on other sites More sharing options...
serdas Posted November 6, 2008 Author Share Posted November 6, 2008 someone suggested script do you know anything about that? how it works? thanks Quote Link to comment Share on other sites More sharing options...
serdas Posted November 6, 2008 Author Share Posted November 6, 2008 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 Quote Link to comment Share on other sites More sharing options...
nocturne00 Posted November 6, 2008 Share Posted November 6, 2008 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 Quote Link to comment Share on other sites More sharing options...
dbroada Posted November 6, 2008 Share Posted November 6, 2008 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. Quote Link to comment Share on other sites More sharing options...
nocturne00 Posted November 6, 2008 Share Posted November 6, 2008 Thanks for the correction Dave. Quote Link to comment Share on other sites More sharing options...
dbroada Posted November 6, 2008 Share Posted November 6, 2008 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. Quote Link to comment Share on other sites More sharing options...
dbroada Posted November 6, 2008 Share Posted November 6, 2008 Is it possible to have something that will help me to update my block information in each drawing without opening each drawingI 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. Quote Link to comment Share on other sites More sharing options...
nocturne00 Posted November 6, 2008 Share Posted November 6, 2008 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 Quote Link to comment Share on other sites More sharing options...
dbroada Posted November 6, 2008 Share Posted November 6, 2008 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 Quote Link to comment Share on other sites More sharing options...
serdas Posted November 6, 2008 Author Share Posted November 6, 2008 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 Quote Link to comment Share on other sites More sharing options...
dbroada Posted November 6, 2008 Share Posted November 6, 2008 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. Quote Link to comment Share on other sites More sharing options...
serdas Posted November 6, 2008 Author Share Posted November 6, 2008 for example how can i import a layer from a different dwg. with commands only Quote Link to comment Share on other sites More sharing options...
serdas Posted November 6, 2008 Author Share Posted November 6, 2008 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.