supermonkey Posted September 19, 2011 Share Posted September 19, 2011 (edited) Hi All, Long term cad user, but still really only know the basics! Discover time savings things every now and then, but I am sure there are some that would really help me out! This list is out of date now, please see POST 11 1. If I have several sets of objects in a drawing that are not blocks, is there an easy way to convert one to a block and "find" & convert the duplicates too? Eg If I have to manually replace 100 it's going to take ages. If I can do this I will then be able to control the objects much more easily (eg scaling them without losing positions). 2. Several items have a few lines of single line text. It is output from another program which I usually manually replace with multiline text. Whilst I know I can convert it, I acutally need to "re-word" it. Is there some script / lisp I may be able to use to do this? 3. I would like to insert a reference number to several items on my drawing (eg A1) and would like to be able to click each one and it auto increment (eg A1, A2, A3 etc). I looked at a lisp routine here, http://www.cadtutor.net/forum/showthread.php?20103-Sequential-numbering-a-single-attribute-value-in-multiple-attribute-block but it seems to be numbering randomly (possibly top down) where I want to number click by click! As an alternative, the tag used is the same as the dxf name, so it could be added to each dxf before import (say centered in the dxf as I could move later) but would need to be quick (eg the script would do all dxfs within a particular folder). 4. May have asked previously, but what is the quickest way to import say 40 dxf files into a single dwg. They do not need to be changed in any way as they are imported, and as long as they are positioned in empty space it doesn't matter where. Thanks Edited September 20, 2011 by supermonkey Direct posters to newer post Quote Link to comment Share on other sites More sharing options...
nestly Posted September 20, 2011 Share Posted September 20, 2011 1) You may be able to use the FILTER and/or QSELECT to isolate your objects on their own layer to make it easier to replace them with blocks. I know there are find/replace lisps, but I really couldn't say if they'd be any use to you. 3) Take a look at LeeMac's Incremental Autonumbering Suite http://lee-mac.com/numinc.html Quote Link to comment Share on other sites More sharing options...
supermonkey Posted September 20, 2011 Author Share Posted September 20, 2011 Hi and thanks for your reply. 1. I'll look into this. 2. I've had some luck with this. I can use find and replace to make the changes so it may be possible to write a LISP routine to do this automatically. Unfortunately, I do not have express tools, so I am using a LISP routine I found. Unfortunately, it is keeping the text on one line. Can anyone advise how I can add an "enter" after the first, second & third lines only? de: (defun c:Combine (/ ss del) ;; Combine all selected text into top-most text object (option to delete others). ;; Text sorting based on Y value ;; Alan J. Thompson, 06.25.10 (vl-load-com) (if (setq ss (ssget "_:L" '((0 . "TEXT")))) ((lambda (i / ent lst str) (initget 0 "Yes No") (setq del (eq "Yes" (getkword "\nDelete originals? [Yes/No] : "))) (while (setq e (ssname ss (setq i (1+ i)))) (setq ent (entget e) lst (cons (list (cdr (assoc 1 ent)) e ent (caddr (assoc 10 ent))) lst) ) ) (setq lst (vl-sort lst (function (lambda (a b) (> (last a) (last b))))) str (caar lst) ) (foreach x (cdr lst) (setq str (strcat str " - " (car x))) (and del (entdel (cadr x)))) (entmod (subst (cons 1 str) (assoc 1 (caddar lst)) (caddar lst))) ) -1 ) ) (princ) ) 3. I actually just found this about half hour before the post above! Really excellent and I wish I knew of it some time ago! I would like more of an oval shape around my text (rather than a circle as my tags are 3 characters long). Is this possible? Is it possible to set default outline, font for it etc? 4. I'm sure this is possible, but perhaps a complicated routine/script? Quote Link to comment Share on other sites More sharing options...
paulmcz Posted September 20, 2011 Share Posted September 20, 2011 I have written a routine that replaces the attribute value with a new one while adding the number increment. Try it and see if you could use it. (defun c:qs (/ ans st nw oerr e1 e2 natt) (setq oerr *error*) (defun *error* (msg) (princ "\n ERROR!") (setq *error* oerr) (command) (princ) ) (if ns (princ (strcat "\n Previous text = " ns)) ) (if ns (setq ans (getstring "\n Keep previous text? [ENTER = yes]: " ) ) ) (if (= ans "") () (setq ns nil st nil ) ) (if ns () (setq ns (getstring t "\n Type in new text: ")) ) (if stt () (setq stt 1) ) (princ "\n Start with number < ") (princ stt) (princ " >?: ") (setq st (getint)) (if (= st nil) (setq st stt) (setq stt st) ) (setq nw (strcat ns (itoa st))) (setq e1 (nentsel "\n Select attribute, do not miss: ")) (while e1 (setq e2 (entget (setq natt (car e1)))) (entmod (subst (cons 1 nw) (assoc 1 e2) e2)) (entupd natt) (if (eq (cdr (assoc 0 e2)) "ATTRIB") (setq st (+ 1 st)) (princ "\n You missed! ") ) (if st (setq nw (strcat ns (itoa st)) stt st ) ) (setq e1 (nentsel "\n Select next attribute or [ENTER] to exit: ")) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
Cad64 Posted September 20, 2011 Share Posted September 20, 2011 2. I've had some luck with this. I can use find and replace to make the changes so it may be possible to write a LISP routine to do this automatically. Unfortunately, I do not have express tools, so I am using a LISP routine I found. Unfortunately, it is keeping the text on one line. Can anyone advise how I can add an "enter" after the first, second & third lines only? Your profile says you're using Autocad LT. If this is true then how are you running lisp routines? Quote Link to comment Share on other sites More sharing options...
supermonkey Posted September 20, 2011 Author Share Posted September 20, 2011 (edited) Your profile says you're using Autocad LT. If this is true then how are you running lisp routines? Oops, my profile needs updating! I'm actually running Bricscad which can run lisp routines perfectly. 2. I think I've found how I can automate my search and replace operation using this: http://www.cadtutor.net/forum/showthread.php?35933-The-Best-Text-Find-And-Replace-LISP-Ever... but will this just perform with the selected text? I thought of a number 5 over night! 5. Is it possible to store a value (eg drawing title & number) somewhere in the drawing and reference to this in other parts of the drawing? Eg - create an issue sheet with attributes and then have layouts named as these attributes with the title box of the layout updating as the issue sheet is updated? Eg If I put "Ground Floor Plan" "201A" the layouts title box automatically displays it? Think this might be possible with attributes etc? Edited September 20, 2011 by supermonkey Quote Link to comment Share on other sites More sharing options...
supermonkey Posted September 20, 2011 Author Share Posted September 20, 2011 Lee Mac appears to be a genius! Going to test these when I get chance! 2. http://lee-mac.com/bfind.html & http://lee-mac.com/text2mtext.html 5. http://lee-mac.com/updatetitleblock.html Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 20, 2011 Share Posted September 20, 2011 Lee Mac appears to be a genius! Going to test these when I get chance! lol I wouldn't go as far as genius... but thanks Quote Link to comment Share on other sites More sharing options...
Sittingbull Posted September 20, 2011 Share Posted September 20, 2011 Lee Mac appears to be a genius! Going to test these when I get chance! 2. http://lee-mac.com/bfind.html & http://lee-mac.com/text2mtext.html 5. http://lee-mac.com/updatetitleblock.html He is! Quote Link to comment Share on other sites More sharing options...
nestly Posted September 20, 2011 Share Posted September 20, 2011 ... and a humble genius at that. Quote Link to comment Share on other sites More sharing options...
supermonkey Posted September 20, 2011 Author Share Posted September 20, 2011 (edited) Hi again, Thought it would be worth updating what I've achieved so far. Note all the Lee Mac Lisp! 1. If I have several sets of objects in a drawing that are not blocks, is there an easy way to convert one to a block and "find" & convert the duplicates too? Eg If I have to manually replace 100 it's going to take ages. If I can do this I will then be able to control the objects much more easily (eg scaling them without losing positions). 2. Going to use http://lee-mac.com/bfind.html & txt2mtxt to automatically re-word some single line text and replace with multiline text. However with bfind I'm getting errors "Error: Automation Error 80020009; Error accessing [GETINTERFACEOBJECT] method. ErrIndex=0". I realised too that with find & replace using \P inserts will create a new paragraph so I can automatically insert a blank line too. 3. To auto increnet reference numbers I am now using http://lee-mac.com/numinc.html However, I would like more of an oval shape around my text (rather than a circle as my tags are 3 characters long). Is this possible? Is it possible to set default outline shape / size & font for it? 4. Can anyone advise on a quick way to import say 40 dxf files into a single dwg. They do not need to be changed in any way, they just need to be insered into empty space and not on top of each other. Ideally they would be aligned by a particular point on the dxf but not essential for now. 5. I have looked at http://lee-mac.com/updatetitleblock.html which uses a CSV file to update drawing titles & numbers in a drawing. I think I either need to change how I work, or modify the program. Currently I have an XLS drawing register - could this be used in place of a CSV or is the presence of graphics etc an issue? Alternatively I have been considering moving my drawing register into the dwg, but if I do that still having to open a CSV would be an inconvenience. I think what I need is a drawing register in my dwg that writes it's contents to a CSV file saved in the same directory. This would then be used with the program above. Thanks Edited September 29, 2011 by supermonkey Quote Link to comment Share on other sites More sharing options...
supermonkey Posted September 27, 2011 Author Share Posted September 27, 2011 Been too busy to look into this any more... any more ideas please? Quote Link to comment Share on other sites More sharing options...
Jack_O'neill Posted September 28, 2011 Share Posted September 28, 2011 Your profile says you are using LT...how are you using the lisp files you mentioned in your first post? Quote Link to comment Share on other sites More sharing options...
paul1966 Posted September 28, 2011 Share Posted September 28, 2011 jack see post number 6 Quote Link to comment Share on other sites More sharing options...
Jack_O'neill Posted September 28, 2011 Share Posted September 28, 2011 jack see post number 6 Oh, ok. I read the first post with the edit that said "see post 11" and skipped to that, didn't read the rest. 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.