desiree Posted November 18, 2009 Posted November 18, 2009 Hey all... I was wondering if anyone had a lisp or batch routine that would assist me. In the title block of our drawings there is a section for checkers initials and date. We have about 600 drawings that need to have this filled in and we do not want to have to go through all the drawings one by one. I know that batch commands would handle a fair bit of drawings but don't know if that can be made to change the bits we need. Thanks for any help. Des Quote
Freerefill Posted November 18, 2009 Posted November 18, 2009 If you can write it, I can batch it. Writing a LISP to fill in data in a block with attributes is easy, one would just need to know the name of the attribute and the data to fill in (as well as how the user would input that data, would it be dynamic or part of the LISP?), the name of the block, stuff like that. For batch purposes, I have a batch engine in my signature that you can check out. I admit it's not quite user-friendly, but it has served me very well, and I don't doubt I could apply a block-attribute-editing LISP to it in minutes. Quote
desiree Posted November 18, 2009 Author Posted November 18, 2009 I would need assistance with the Lisp routine as well. I have not mastered them and in honesty haven't written one that works yet. If anyone is able to write one let me knwo the information needed and I will provide it. It would be a great help Quote
Freerefill Posted November 18, 2009 Posted November 18, 2009 Try this. It prompts you to select the block you want, but we can work on that. I just want to see if this is doing what you'd like it to do. Note that it will ask you for the attribute tag, so you should know what it is before you run the LISP. If it works, then we can tweak it so that it automatically selects the block you want to edit. (defun c:blkEdit( / ent attTag attVal) (setq ent (car (entsel "\nSelect block: ")) attTag (getstring "\nEnter attribute tag: ") attVal (getstring "\nEnter desired value for attribute: ")) (blkTagEdit ent attTag attVal) ) (defun blkTagEdit(blkEnt attTag attVal / attEnt attLst) (if (= (cdr (assoc 66 (entget blkEnt))) 1) (progn (setq attEnt (entnext blkEnt)) (while (/= (cdr (assoc 0 (entget attEnt))) "SEQEND") (if attEnt (setq attLst (cons (cons (cdr (assoc 2 (entget attEnt))) attEnt) attLst))) (setq attEnt (entnext attEnt))) (if attLst (mapcar '(lambda (x) (vla-put-textString (vlax-ename->vla-object (cdr x)) attVal)) (vl-remove-if-not '(lambda (x) (= (car x) attTag)) attLst))) ) ) (princ) ) Quote
autouser Posted November 19, 2009 Posted November 19, 2009 Hi freerefill, I am also looking for ways to input back into block as attribute. I have excel file created from _eattext. Is there any way to import that excel file to block attributes drawings back after modified? Thanks Quote
Freerefill Posted November 19, 2009 Posted November 19, 2009 I haven't used eattext much, but I believe you should be able to import whatever you need. You'll just need to know how to link everything together, that is to say, what piece of information goes where. Quote
fixo Posted November 19, 2009 Posted November 19, 2009 Hey all... I was wondering if anyone had a lisp or batch routine that would assist me. In the title block of our drawings there is a section for checkers initials and date. We have about 600 drawings that need to have this filled in and we do not want to have to go through all the drawings one by one. I know that batch commands would handle a fair bit of drawings but don't know if that can be made to change the bits we need. Thanks for any help. Des I have similar one on what you need Unfortunatelly I'm not an owner of source code - I gave it to my mate, by this reason I can't edit it too See how it will be work for you - try first on your backup folder! ~'J'~ coffee.zip Quote
fixo Posted November 19, 2009 Posted November 19, 2009 Forgot to say I tested it on 2 machines (A2008eng) ~'J'~ Quote
autouser Posted November 20, 2009 Posted November 20, 2009 Hi Freerefill, thanks .... but how do i actually do that as I am not very familiar with coding in autocad. I just want to export some attributes in title block modify them and import them back to the exact same place. thanks Quote
fixo Posted November 20, 2009 Posted November 20, 2009 Hi Freerefill, thanks .... but how do i actually do that as I am not very familiar with coding in autocad. I just want to export some attributes in title block modify them and import them back to the exact same place. thanks You can try this routine to export title block ~'J'~ tex.LSP Quote
fixo Posted November 20, 2009 Posted November 20, 2009 ...modify them and import them back to the exact same place. thanks The following one will be allow you to import attributes back from file that would be created with help of my prior routine tex.lsp Keep in mind you need to select block that has been exported into the Excel before otherwise you will be get an error message (say you clicked title block from layot2 but in fact you exported it from layout1) ~'J'~ tim.LSP Quote
autouser Posted November 23, 2009 Posted November 23, 2009 Thanks fixo ... I will give it a try ....Cheers Quote
autouser Posted November 23, 2009 Posted November 23, 2009 Hi fixo, it works ..... just wondering how do i do that to apply to same title blocks in different sheets and different drawings simultanuously? Thanks again. Quote
autouser Posted November 23, 2009 Posted November 23, 2009 fixo ...... i am thinking is it possible to "search" for the title blocks in all sheets and all drawings in the folder or sheet set and export the attributes to the one excel file with different rows. Without user input. And import all of them back to drawings without user input as well (maybe via sheet set or something). thanks dude you are the man...... Quote
fixo Posted November 24, 2009 Posted November 24, 2009 fixo ...... i am thinking is it possible to "search" for the title blocks in all sheets and all drawings in the folder or sheet set and export the attributes to the one excel file with different rows. Without user input. And import all of them back to drawings without user input as well (maybe via sheet set or something). thanks dude you are the man...... Sorry, I have a serious disease now Perhaps I'll out of my work 2-3 days or so Later I'll try to rewrite it to your suit Stay watching this thread ~'J'~ Quote
autouser Posted November 24, 2009 Posted November 24, 2009 cheers mate .... i thought you are already running away from this thread. hmmm.... i really need to learn to program in autocad. take care. Quote
fixo Posted November 26, 2009 Posted November 26, 2009 cheers mate .... i thought you are already running away from this thread. hmmm.... i really need to learn to program in autocad. take care. Thanks, Here is the first one from two routines This will allow you import all title blocks on all layouts entire the selected folder You can change Excel file name inside the code as you need it ~'J'~ btex.lsp Quote
autouser Posted November 27, 2009 Posted November 27, 2009 Hi fixo ..... glad you are back .... when i run the program .... it asks me to type in the block name and then ask me to select the folder. After that message come up and say be patient and please wait with ok button. And when i click ok it open the file in new window save the excel file. But when i open the file there is nothing there. Am i missing something? thanks Quote
fixo Posted November 27, 2009 Posted November 27, 2009 Hi fixo ..... glad you are back .... when i run the program .... it asks me to type in the block name and then ask me to select the folder. After that message come up and say be patient and please wait with ok button. And when i click ok it open the file in new window save the excel file. But when i open the file there is nothing there. Am i missing something? thanks Perhaps, problem is on that this block does not exist I ended up the second part to batch changing title blocks entire the folder - working good too on my end I will be varnish it a bit then I'll send here ~'J'~ Quote
fixo Posted November 27, 2009 Posted November 27, 2009 ============= Here is the second one I tested it many times on my A2008 Working good too Keep in mind you can fill Excel file before with help of btex.lsp I sent above ~'J'~ btim.LSP 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.