kabcad Posted August 15, 2011 Share Posted August 15, 2011 The attached lisp routine worked perfectly in AutoCAD 2011 but acts a bit strange in 2012. It will strill bring in the block but it won't bring up the attribute dialog box correctly as before. I have to hit enter through all the attributes instead of just using the dialog box. Can someone smarter than me figure out what may be happening with this routine in AutoCAD 2012 now? Thank you, Keith dcut.lsp BUB.dwg Quote Link to comment Share on other sites More sharing options...
Cherilm Posted August 16, 2011 Share Posted August 16, 2011 (edited) kabcad; I haven't tested your routine, but it sounds an awful lot like you need to change a setting in your drawing ATTDIA to be 1, that same thing happens to me in 2002 when my dialog boxes are suppressed by that variable. When ATTDIA is set to 0, you have to manually enter your block attributes at the prompt. (I didn't double check the name of the attribute dialogue variable, I don't have time, but you can dig for it if I got the wrong one.). Good luck. Edited August 16, 2011 by Cherilm to add Quote Link to comment Share on other sites More sharing options...
kabcad Posted August 16, 2011 Author Share Posted August 16, 2011 Thanks but I did check that variable and it is set to 1 already. If I bring the block in using the basic insert command, it works like it should (dialog box appears) but using my lisp routine is does not. Quote Link to comment Share on other sites More sharing options...
Cherilm Posted August 16, 2011 Share Posted August 16, 2011 Okay, and also I am still in 2002, we have 2011 but we have no need to migrate to it. It looks like I may do so soon because it does have some cool features the previous versions don't. And it just occurred to me, maybe something in your routine is changing that variable back to '0'. Just a thought. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted August 16, 2011 Share Posted August 16, 2011 See if ATTREQ = 1. Quote Link to comment Share on other sites More sharing options...
Guest kruuger Posted August 16, 2011 Share Posted August 16, 2011 i guess there is a bug with ATTREQ in 2012. when you insert your block try this: (command "_.ddedit" (entlast)) k. Quote Link to comment Share on other sites More sharing options...
kabcad Posted August 16, 2011 Author Share Posted August 16, 2011 i guess there is a bug with ATTREQ in 2012.when you insert your block try this: (command "_.ddedit" (entlast)) k. k- Where would I insert this line of code within my lisp routine? thanks. kb Quote Link to comment Share on other sites More sharing options...
Guest kruuger Posted August 16, 2011 Share Posted August 16, 2011 k-Where would I insert this line of code within my lisp routine? thanks. kb try this: (defun c:BU (/ *error* CE VL OV) (defun *error* (Msg) (if (= 8 (logand 8 (getvar "UNDOCTL"))) (command "._undo" "_e") ) (if (not (member MSG '("Function cancelled" "quit / exit abort"))) (princ (strcat "\nError: " MSG)) ) (mapcar 'setvar VL OV) (setvar "CMDECHO" CE) (princ) ) (setq CE (getvar "CMDECHO")) (setvar "CMDECHO" 0) (command "._undo" "_be") (setq VL (list "ATTDIA" "ATTREQ" "CLAYER" "DIMSCALE" "ORTHOMODE") OV (mapcar 'getvar VL) ) (command "._layer" "_m" "DETCUT" "_c" 4 "" "") (setvar "ATTDIA" 1) (setvar "ATTREQ" 1) (setvar "ORTHOMODE" 1) (princ "\nInsertion point: ") (command "._insert" "BUB" "_s" (/ (getvar "DIMSCALE") 96.) "_r" pause pause) (while (/= (getvar "CMDNAMES") "") (command pause) ) (command "_.ddedit" (entlast)) (command) (command "._undo" "_e") (mapcar 'setvar VL OV) (setvar "CMDECHO" CE) (princ) ) (princ) k. Quote Link to comment Share on other sites More sharing options...
kabcad Posted August 17, 2011 Author Share Posted August 17, 2011 try this: (defun c:BU (/ *error* CE VL OV) (defun *error* (Msg) (if (= 8 (logand 8 (getvar "UNDOCTL"))) (command "._undo" "_e") ) (if (not (member MSG '("Function cancelled" "quit / exit abort"))) (princ (strcat "\nError: " MSG)) ) (mapcar 'setvar VL OV) (setvar "CMDECHO" CE) (princ) ) (setq CE (getvar "CMDECHO")) (setvar "CMDECHO" 0) (command "._undo" "_be") (setq VL (list "ATTDIA" "ATTREQ" "CLAYER" "DIMSCALE" "ORTHOMODE") OV (mapcar 'getvar VL) ) (command "._layer" "_m" "DETCUT" "_c" 4 "" "") (setvar "ATTDIA" 1) (setvar "ATTREQ" 1) (setvar "ORTHOMODE" 1) (princ "\nInsertion point: ") (command "._insert" "BUB" "_s" (/ (getvar "DIMSCALE") 96.) "_r" pause pause) (while (/= (getvar "CMDNAMES") "") (command pause) ) (command "_.ddedit" (entlast)) (command) (command "._undo" "_e") (mapcar 'setvar VL OV) (setvar "CMDECHO" CE) (princ) ) (princ) k. Kruuger, Thank you very much for your effort on this. I tried this code and it worked but the one thing that is different than before is that it brings up the attribute EDITOR dialog box instead of the attribute INPUT dialog box. Does that make sense? I already have the attributes defined in the BUB.dwg block so all I need to do is change the values once the block gets inserted into the drawing (detail cut number and sheet number). Thank you again for helping me with this... Keith 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.