mfkozlow
13.08.2014, 20:23
Hello everyone!I found some code (lisp) that will return a variable with the attribute value of a block. Everything works great, the block only has one attribute so it does not cause complications in this rather simple code. My problem is with the user input portion. After the code lisp is initiated, AutoCAD asks me to select the block I wish to extract the attribute value form. Ideally I would like this to happen automatically. I want the lisp to always check the same exact block that will be located in the same exact spot. If anyone knows a way please let me know! I have been working on this for way too long. Here is the lisp:(defun C:get_att_now ()(if (setq ent(entsel "\n Select a Block: "))(progn (setq en(car ent)) (setq enlist(entget en)) (setq blkType(cdr(assoc 0 enlist))) (if (= blkType "INSERT") (progn (if(= (cdr(assoc 66 enlist)) 1) (progn (setq en2(entnext en)) (setq enlist2(entget en2)) (setq enlist3(cdr(assoc 1 enlist2))) (while (/= (cdr(assoc 0 enlist2)) "SEQEND") (princ "\n ") (princ enlist2) (setq en2(entnext en2)) (setq enlist2(entget en2)) ) ) ) ) ) )) )Note: This is the code that causes user input...(if (setq ent(entsel "\n Select a Block: "))I have tried the "ssget" function, but haven't had any luck. Please help!