daveyboyd Posted January 8, 2010 Posted January 8, 2010 Hi, I am wondering if you can program a script to enable me to change a piece of Mtext within a block. I have a bunch of drawing files which have our company border on them inserted as a block, within the border block I have some Mtext giving the scheme title, unfortunatley due to things dragging along the scheme has now ran into 2010, the drawings have 2009 on them! I need a scritpt that I can open said title block and change the Mtext from 2009 to 2010 and close the block, save etc for all my drawings. Is this possible? I have scriptpro installed but dont know what to ask . . . Thanks for your help Dave Quote
dbroada Posted January 8, 2010 Posted January 8, 2010 I wouldn't try to do the MTEXT change (if it is part of a block) with a script as there are easier ways. I would open up the block and make the changes there and then reinsert the block into the drawing. This is relatively easy using a script. You need to make sure the new block definition is available, either by putting it in the current folder or in a searched folder. Then... -insert BlockName= 0,0 1 1 0 erase l qsave the = after block name tells AutoCAD to redefine the existing block from the external drawing file. If doing it by hand you can here but I don't know a way of escaping a script cleanly so I insert a new instance of the block @ 0,0, x scale, y scale (might need a z scale too?), and 0 rotation and then delete the block you have just put in. Job done You may need a zoom extents before the erase last as AutoCAD used to erase the last visible entry but now erases the very last entry. Quote
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.