Jump to content

Block insertion not working same in ACAD 2012 vs 2011


kabcad

Recommended Posts

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

Link to comment
Share on other sites

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 by Cherilm
to add
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Guest kruuger
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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...