AutoCAD/attribute extraction
Expert: Bill DeShawn - 12/11/2007
QuestionQUESTION: In 2006 this option was listed in the tools dropdown. It is not there in 2008. I use this for counting a certain block in my drawings...where did it go?
ANSWER: Marsha:
The command name is:
_eattext
I haven't loaded 2008 yet. There are too many complaints of it being sloooww. So, I'll stick with 2006 for now. But if _eattext is gone, try this:
(defun bcerr (msg)
(if c:r (c:r) redraw)
(setq ##aa nil ##xss nil ##n nil)
(setq *error* olderr)
(princ msg)
(prompt ". Please try again.")
(princ)
)
(defun get_bname (/ )
(setq ##aa (getstring T "\nType name of block or press ENTER to select: "))
(if (= ##aa "")
(progn
(setq ent (entsel "\nSelect the block to get its name: "))
(setq elist (entget (car ent)))
(setq ##aa (cdr (assoc 2 elist)))
)
)
(if (not (tblsearch "BLOCK" ##aa))
(progn
(prompt (strcat "\nBlock: " (strcase ##aa)" ....not found. "))
(setq ##aa nil)
)
)
(prin1)
)
(defun ct_blk (/ )
(setq ##xss (ssget "X" (List (cons 2 ##aa))))
(if ##xss
(setq ##n (sslength ##xss))
)
)
(defun C:BC (/ ##aa ##xss ##n)
(setq olderr *error* *error* bcerr)
(get_bname)
(if ##aa
(progn
(ct_blk)
(cond ( (> ##n 1)
(prompt (strcat
"\nBlock: " (strcase ##aa) " occurs " (itoa ##n) " times."))
)
( (= ##n 1)
(prompt (strcat
"\nBlock: " (strcase ##aa) " occurs one time.")))
(t (prompt (strcat "\nBlocks: " (strcase ##aa)
" not currently inserted."
)
)
) )
)
)
(setq *error olderr)
(princ)
)
(princ "BC.LSP - Loaded! ")(princ)
Paste above text in a text file and call it BC.lsp
Load it with APPLOAD or type: (load "bc")
Then type BC to start the block count routine.
Keep in touch
Bill DeShawn
http://my.sterling.net/~bdeshawn
---------- FOLLOW-UP ----------
QUESTION: Hi Bill, thanks for the reply, but _eattext brings up a data extraction window, that appears to be different than the attribute extraction window. Marsha
ANSWER: Marsha:
EATTEDIT has evolved. As Lynn Allen puts it, it has been taken to the next level. This means the interface is different and the dialogs are different and it will take a little time with research and reading, but according to Lynn Allen, "it's easy". Well, that'll be for all of us to judge, won't it. Her blog on the subject is here:
http://management.cadalyst.com/cadman/Column:++Circles+and+Lines/Circles-and-Lin
You might have to paste the above into NOTEPAD and take out the "Hard Return".
Lynn talks about block counts here:
http://lynn.blogs.com/lynn_allens_blog/2007/07/a-rainy-autocad.html
Here is a web page that looks like your help file:
http://www.kxcad.net/autodesk/autocad/AutoCAD_2008_Command_Reference/d0e42769.ht
It's going to take some reading, but know that the old command is gone, however, you can use the new command and accomplish the same thing (and more if you want).
Keep in touch
Bill DeShawn
http://my.sterling.net/~bdeshawn
---------- FOLLOW-UP ----------
QUESTION: Thanks Bill. I will study up with those web sites you gave me. Meanwhile I have encountered another problem I hope you can solve...I think it is a setting issue ....when I click on the "layer properties manager" nothing happens. '_layer comes up at the command line and unless I hit escape the computer just makes a bong sound and neither shows me the layer properties dialogue box nor allows me to do anything else. I have tried typing in layer properties on the command line, but nothing I do will let me look at the dialogue box. This was working fine..and then just stopped. I think the problem is with the ' sign that is in front. Help! Thanks.
AnswerMarsha:
Have you done any work in ACAD.PGP or ALIASEDIT lately? Did you possible work with a LAYER command alias? Try using the LAYER command with a dot in front: .LAYER
If you can get it working like that, then that can be a clue to what's going on. Get back to me with the info.
Also, can you please start a new question about this problem? This one is still riding on the block count question and that one is resolved unless you want to talk about that one some more.
Thanks.
Bill DeShawn
http://my.sterling.net/~bdeshawn