stinger Posted May 14, 2009 Posted May 14, 2009 hi guys i'm new in this forum, can somebody help me on the ff: i'm producing drawings with tag of an item, each tag has many parts sometimes approx. 20 parts., each parts has attribute to it . . that is - part no., dimension, quantity and classification ( i.e. metal, wood, stone ...etc.). . . now can somebody know a routine ( lisp ) that extract all parts in the drawing and sort it and put it in the same drawing in table but group according to its classification (i. e. metal, wood, stone ..etc.) thanks you very much Quote
flowerrobot Posted May 14, 2009 Posted May 14, 2009 Some thing like this would be a start. (setq ss1 (ssget)) (setq en (ssname ss1 0)) (setq edata (entget en)) (setq blockdata nil) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (while (not(= (cdr (assoc 0 edata)) "SEQEND")) (setq blockdata (cons (cons (cdr (assoc 2 edata)) (cdr (assoc 1 edata))) blockdata)) (setq edata (entget (entnext (cdr (assoc -1 edata))))) ) Quote
MarcoW Posted May 14, 2009 Posted May 14, 2009 Do you mean following (put in commandline and press enter): EATTEXT Should do the trick... Quote
stinger Posted May 14, 2009 Author Posted May 14, 2009 Some thing like this would be a start. (setq ss1 (ssget)) (setq en (ssname ss1 0)) (setq edata (entget en)) (setq blockdata nil) (setq edata (entget (entnext (cdr (assoc -1 edata))))) (while (not(= (cdr (assoc 0 edata)) "SEQEND")) (setq blockdata (cons (cons (cdr (assoc 2 edata)) (cdr (assoc 1 edata))) blockdata)) (setq edata (entget (entnext (cdr (assoc -1 edata))))) ) thank you for the code,it's great !! right now i'm using the dataextraction command and manually filtering all the atribute in order to get the right values , can I automate this process in order to extract this values only in one click ? Quote
Lee Mac Posted May 14, 2009 Posted May 14, 2009 You could make a macro: ^C^C-eattext;C;Y; ... etc etc Just follow the prompts and see what you can do Quote
stinger Posted May 15, 2009 Author Posted May 15, 2009 You could make a macro: ^C^C-eattext;C;Y; ... etc etc Just follow the prompts and see what you can do thanks man! Quote
MarcoW Posted December 2, 2009 Posted December 2, 2009 You could make a macro: ^C^C-eattext;C;Y; ... etc etc Just follow the prompts and see what you can do Lee, I am using eattext a lot. But of course I have a problem with it... as usual I only seem to have problems First of all, the macro you provided does not work for me. Maybe I should approach my goal in a different way so let's leave that for what it is. (in the meantime I ask myself: "Will Lee notice this message, should I PM him...?) To automate the process of a standard attribute extraction I thought I make a lisproutine for it, based on a previous extraction. (If used eattext you can save the extraction for later use, template alike...) In fact if a rountine would be like: (defun c:do_it () (command "-eattext" "<path + name>") (princ)) .. it works... but not 100%... Imagine I would have a new project, let's say 10 dwg's in a specific map. Those dwg's should be handled. If used eattext I have the option to select specific drawings but I want to automate the process. When using -eattext in lisp, I can only give the template and thats it. Of course it extracts the dwg's that were set at the time the template was created. So how would I be able to 1. create an attribute extraction based on a previous saved template 2. get the option to select a folder or multiple dwg's as it is in the eattext command 3. put it in a table In stead of the template I mentioned I could try to set the variables as needed in the routine, so the template can be forgotten. These are the variables (in toddler-kinda-explain): - it should be a new extraction each time - drawings -> do not include current drawing - only select blocks with one specific blockname "BLOCKNAME" ... while typing this I am afraid that it gets to complex for I need the results (table) to be the same each time. I think its best to have your opinion before "dreaming further"... Quote
Lee Mac Posted December 2, 2009 Posted December 2, 2009 Hi Marco, I believe this could be achieved, but rather through a custom LISP function, as opposed to relying on the EATTEXT command as you can have more control over the blocks, and it would be more robust. But this is quite a complex task, and would take quite a lot of time to put together. Quote
fixo Posted December 2, 2009 Posted December 2, 2009 hi guys i'm new in this forum, can somebody help me on the ff: i'm producing drawings with tag of an item, each tag has many parts sometimes approx. 20 parts., each parts has attribute to it . . that is - part no., dimension, quantity and classification ( i.e. metal, wood, stone ...etc.). . . now can somebody know a routine ( lisp ) that extract all parts in the drawing and sort it and put it in the same drawing in table but group according to its classification (i. e. metal, wood, stone ..etc.) thanks you very much Take a look at this thread it may give you some ideas about http://www.cadtutor.net/forum/showthread.php?t=42174&page=2 ~'J'~ 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.