CAD Forums > CAD General

Update the definition and all of its block references? - STOP ASKING ME THIS!!!!

(1/4) > >>

Keith™:
Maybe I am getting old (that has to be it) or maybe I am just too stupid to know what is going on.

I am being annoyed with a stupid popup every time I want to insert a block. "[block] is already defined. 432 block references already exist in the drawing. Update the definition and all of its block references?"

Um .. NO and I didn't want to be prompted 432 times already!

Expert is no help
BlockRedefineMode is no help

what the heck is going on?

Every time I enter a block name, it always wants to refer back to the file and insert from the drawing file and not from the block definition already in the drawing.

Someone please help me .. I am losing my mind over here!

ribarm:
Are you trying to redefine definitions and update insertions?
Is this happening when you insert block into DWG from DWG file?

If answer is yes, then I suggest that you collect all dwgs from folder where you gather all blocks for redefine and create script that will do INSERT command and always answer on question Yes/No as Yes...

If you already have definitions and you are just inserting them from DWG, then I also don't know what's going on - there should be no questions of any kind...

Some link...
https://www.cadtutor.net/forum/topic/71630-redefine-every-single-blocks-contained-in-a-drawing-from-block-library-folder-path/

Look at Mr. Lee Mac answer...

Keith™:
The blocks are already in the drawing ...
I am a keyboard commando most of the time, but I use the insert dialog ...

I simply type I [ENTER]
The GUI pops up
I type the name in the Name combo and press [ENTER]

NO!!!! I DO NOT WANT TO GET NOTIFIED!!! STOP IT!!!

I have literally inserted this block 432 times in this drawing give up already! If I haven't said yes in the last 432 times, why would I say yes on the 433 time?!

I dunno ... it didn't use to do this when I was able to use CAD on my Win 10 x64 PC ... before Autodesk refused to allow me to use my perfectly legitimate license on that PC .. so I am relegated to using it on my old Win 7 x64 PC because apparently they want me to purchase a subscription instead of a perpetual license.

ugh, I hate this company

Sorry for the rant! I've been working on these drawings all day and it is wearing on me!

Rustabout:
I've been having decent success with AutoCAD clones. But it takes some work to get used to them. You have to enjoy tinkering around with them let's say. And they come with their own unique set of frustrations.

I absolutely HATE AutoCAD's new 'insert' interface. I avoided the old one as well. I've always used the "-insert" command when I had the name of the block memorized. For frequently inserted blocks I would make a basic LISP. Or Macro when forced to use AutoCAD LT. I was able to get surprisingly fast performance out of AutoCAD LT by configuring a really slick Ribbon panel setup.

Give the "-insert" command a whirl and see if it still prompts you.

ribarm:
Keith, give this lisp a try... I know, dialog box gives a preview of blocks without showing attributes, but it uses (vla-sendcommand) to finally insert block you choose... It was me that mod. Mr. Lee's BlockPreview DCL example, but I use it very well... I think that it may be helpful and to you...
Regards, M.R.


--- Code - Auto/Visual Lisp: ---(defun c:binsert ( / *error* LM:BlockPreview RefGeom LM:Entity->PointList trp mxm mxv _blockpreview _ins dcl def des lst tmp bln )     (vl-load-com)     (defun *error* ( msg )        (if (< 0 dcl)            (unload_dialog dcl)        )        (if (= 'file (type des))            (close des)        )        (if (and tmp (findfile tmp))            (vl-file-delete tmp)        )        (if (and msg (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")))            (princ (strcat "\nError: " msg))        )        (princ)    )     (defun-q LM:BlockPreview ( key block margin / _getcolour _getvectors _unique bn cache dy ec el en mi mx pl r1 r2 sc vc vl xt yt )        (setq cache '( ))         (defun _getcolour ( l / c )            (cond                (   (= 0 (setq c (cdr (assoc 62 l))))                    7                )                (   (or (null c) (= 256 c))                    (abs (cdr (assoc 62 (tblsearch "LAYER" (cdr (assoc 8 l))))))                )                (   c   )            )        )         (defun _getvectors ( bn / ec el en pl rg vl )            (if (setq en (tblobjname "BLOCK" bn))                (while (setq en (entnext en))                    (setq el (entget en))                    (cond                        (   (= 1 (cdr (assoc 60 el))))                        (   (= "INSERT" (cdr (assoc 0 el)))                            (setq rg (RefGeom en))                            (setq vl                                (append vl                                    (mapcar                                        (function                                            (lambda ( x )                                                (append                                                    (mapcar '+ (mxv (car rg) (list (car   x) (cadr   x) 0.0)) '(0 0) (cadr rg))                                                    (mapcar '+ (mxv (car rg) (list (caddr x) (cadddr x) 0.0)) '(0 0) (cadr rg))                                                    (cddddr x)                                                )                                            )                                        )                                        (_getvectors (cdr (assoc 2 el)))                                    )                                )                            )                        )                        (   (setq pl (LM:Entity->PointList en))                            (if (or (= "POINT" (cdr (assoc 0 el))) (vlax-curve-isclosed en))                                (setq pl (cons (last pl) pl))                            )                            (setq ec (_getcolour el))                            (setq vl                                (append vl                                    (mapcar                                        (function                                            (lambda ( a b )                                                (list (car a) (cadr a) (car b) (cadr b) ec)                                            )                                        )                                        pl (cdr pl)                                    )                                )                            )                        )                    )                )            )            vl        )         (defun _unique ( l / a r )            (while (setq a (car l))                (setq r (cons a r)                      l (vl-remove-if (function (lambda ( b ) (equal a b))) (cdr l))                )            )            (reverse r)        )         (cond            (   (or (< margin 0)                    (<= (setq xt (dimx_tile key)) (* 2 margin))                    (<= (setq yt (dimy_tile key)) (* 2 margin))                )                nil            )            (   (setq vl (assoc (strcase block) cache))                (foreach x (cdr vl) (apply 'vector_image x))                t            )                        (   (setq vl (_getvectors block))                (setq mi (apply 'mapcar (cons 'min vl))                      mx (apply 'mapcar (cons 'max vl))                      mi (list (min (car mi) (caddr mi)) (min (cadr mi) (cadddr mi)))                      mx (list (max (car mx) (caddr mx)) (max (cadr mx) (cadddr mx)))                      r1 (/ (- (car  mx) (car  mi)) (- xt (* 2 margin)))                      r2 (/ (- (cadr mx) (cadr mi)) (- yt (* 2 margin)))                )                (cond                    (   (and (equal r1 r2 1e-8) (equal r1 0.0 1e-8))                        (setq sc 1.0                              vc (mapcar '- mi (list (/ xt 2.0) (/ yt 2.0)))                        )                    )                    (   (equal r1 r2 1e-8)                        (setq sc r1                              vc (mapcar '(lambda ( x ) (- x (* sc margin))) mi)                        )                    )                    (   (< r1 r2)                        (setq sc r2)                        (setq vc                            (list                                (- (car  mi) (/ (- (* sc xt) (- (car mx) (car mi))) 2.0))                                (- (cadr mi) (* sc margin))                            )                        )                    )                    (   t                        (setq sc r1)                        (setq vc                            (list                                (- (car  mi) (* sc margin))                                (- (cadr mi) (/ (- (* sc yt) (- (cadr mx) (cadr mi))) 2.0))                            )                        )                    )                )                (setq vc (append vc vc))                (   (setq LM:BlockPreview                        (vl-list* '( key block margin )                             (list 'setq 'cache                                 (list 'quote                                     (cons                                         (cons (strcase block)                                             (_unique                                                 (mapcar                                                     (function                                                         (lambda ( a / x )                                                             (setq x (mapcar '(lambda ( a b ) (fix (/ (- a b) sc))) a vc))                                                             (list                                                                 (car x)                                                                 (- yt (cadr x))                                                                 (caddr x)                                                                 (- yt (cadddr x))                                                                 (last a)                                                             )                                                         )                                                     )                                                     vl                                                 )                                             )                                         )                                         cache                                     )                                 )                             )                             (cddr LM:BlockPreview)                        )                    )                    key block margin                )            )        )    )     (defun RefGeom ( ename / elst ang norm mat )        (setq elst (entget ename)              ang  (cdr (assoc 50 elst))              norm (cdr (assoc 210 elst))        )        (list            (setq mat                (mxm                    (mapcar '(lambda ( v ) (trans v 0 norm t))                       '(                            (1.0 0.0 0.0)                            (0.0 1.0 0.0)                            (0.0 0.0 1.0)                        )                    )                    (mxm                        (list                            (list (cos ang) (- (sin ang)) 0.0)                            (list (sin ang) (cos ang)     0.0)                           '(0.0 0.0 1.0)                        )                        (list                            (list (cdr (assoc 41 elst)) 0.0 0.0)                            (list 0.0 (cdr (assoc 42 elst)) 0.0)                            (list 0.0 0.0 (cdr (assoc 43 elst)))                        )                    )                )            )            (mapcar '- (trans (cdr (assoc 10 elst)) norm 0)                (mxv mat (cdr (assoc 10 (tblsearch "BLOCK" (cdr (assoc 2 elst))))))            )        )    )     (defun LM:Entity->PointList ( ent / der di1 di2 di3 elst fun inc lst par rad )        (setq elst (entget ent))        (cond            (   (eq "POINT" (cdr (assoc 0 elst)))                (list (cdr (assoc 10 elst)))            )            (   (eq "LINE" (cdr (assoc 0 elst)))                (list (cdr (assoc 10 elst)) (cdr (assoc 11 elst)))            )            (   (member (cdr (assoc 0 elst)) '("CIRCLE" "ARC"))                (setq di1 0.0                      di2 (vlax-curve-getdistatparam ent (vlax-curve-getendparam ent))                      inc (/ di2 (1+ (fix (* 35.0 (/ di2 (cdr (assoc 40 elst)) (+ pi pi))))))                      fun (if (vlax-curve-isclosed ent) < <=)                )                (while (fun di1 di2)                    (setq lst (cons (vlax-curve-getpointatdist ent di1) lst)                          di1 (+ di1 inc)                    )                )                lst            )            (   (or (eq (cdr (assoc 0 elst)) "LWPOLYLINE")                    (and (eq (cdr (assoc 0 elst)) "POLYLINE") (zerop (logand (cdr (assoc 70 elst)) 80)))                )                (setq par 0)                (repeat (fix (1+ (vlax-curve-getendparam ent)))                    (if (setq der (vlax-curve-getsecondderiv ent par))                        (if (equal der '(0.0 0.0 0.0) 1e-8)                            (setq lst (cons (vlax-curve-getpointatparam ent par) lst))                            (if (setq rad (distance '(0.0 0.0) (vlax-curve-getfirstderiv ent par))                                      di1 (vlax-curve-getdistatparam ent par)                                      di2 (vlax-curve-getdistatparam ent (1+ par))                                )                                (progn                                    (setq inc (/ (- di2 di1) (1+ (fix (* 35.0 (/ (- di2 di1) rad (+ pi pi)))))))                                    (while (< di1 di2)                                        (setq lst (cons (vlax-curve-getpointatdist ent di1) lst)                                              di1 (+ di1 inc)                                        )                                    )                                )                            )                        )                    )                    (setq par (1+ par))                )                (if (or (vlax-curve-isclosed ent) (equal '(0.0 0.0 0.0) der 1e-8))                    lst                    (cons (vlax-curve-getendpoint ent) lst)                )            )            (   (eq (cdr (assoc 0 elst)) "ELLIPSE")                (setq di1 (vlax-curve-getdistatparam ent (vlax-curve-getstartparam ent))                      di2 (vlax-curve-getdistatparam ent (vlax-curve-getendparam   ent))                      di3 (* di2 (/ (+ pi pi) (abs (- (vlax-curve-getendparam ent) (vlax-curve-getstartparam ent)))))                )                (while (< di1 di2)                    (setq lst (cons (vlax-curve-getpointatdist ent di1) lst)                          der (distance '(0.0 0.0) (vlax-curve-getsecondderiv ent (vlax-curve-getparamatdist ent di1)))                          di1 (+ di1 (/ di3 (1+ (fix (/ 35.0 (/ di3 der (+ pi pi)))))))                    )                )                (if (vlax-curve-isclosed ent)                    lst                    (cons (vlax-curve-getendpoint ent) lst)                )            )            (   (eq (cdr (assoc 0 elst)) "SPLINE")                (setq di1 (vlax-curve-getdistatparam ent (vlax-curve-getstartparam ent))                      di2 (vlax-curve-getdistatparam ent (vlax-curve-getendparam   ent))                      inc (/ di2 25.0)                )                (while (< di1 di2)                    (setq lst (cons (vlax-curve-getpointatdist ent di1) lst)                          di1 (+ di1 inc)                    )                )                (if (vlax-curve-isclosed ent)                    lst                    (cons (vlax-curve-getendpoint ent) lst)                )            )        )    )     (defun trp ( m )        (apply 'mapcar (cons 'list m))    )     (defun mxm ( m n )        ((lambda ( a ) (mapcar '(lambda ( r ) (mxv a r)) m)) (trp n))    )     (defun mxv ( m v )        (mapcar '(lambda ( r ) (apply '+ (mapcar '* r v))) m)    )     (defun _blockpreview ( blk )        (start_image "img")        (fill_image 0 0 (dimx_tile "img") (dimy_tile "img") 0)        (LM:BlockPreview "img" blk 5)        (end_image)    )     (defun _ins ( bln )        (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) (strcat "_.-INSERT\n" bln "\n"))    )     (while (setq def (tblnext "BLOCK" (null def)))        (if            (and                (= 0 (logand 125 (cdr (assoc 70 def))))                (not (wcmatch (cdr (assoc 2 def)) "`_*,`**,*|*"))            )            (setq lst (cons (cdr (assoc 2 def)) lst))        )    )     (cond        (   (null (setq lst (vl-sort lst '<)))            (princ "\nNo blocks found in drawing.")        )        (   (null                (and                    (setq tmp (vl-filename-mktemp nil nil ".dcl"))                    (setq des (open tmp "w"))                    (foreach line                       '(                            "blockpreview : dialog"                            "{"                            "    label = \"Block Preview\";"                            "    initial_focus = \"lst\";"                            "    spacer;"                            "    : row"                            "    {"                            "        : list_box { key = \"lst\"; width = 30.0; fixed_width = true; }"                            "        spacer;"                            "        : image"                            "        {"                            "            key = \"img\";"                            "            width = 33.5;"                            "            aspect_ratio = 1.0;"                            "            fixed_width = true;"                            "            fixed_height = true;"                            "        }"                            "    }"                            "    spacer;"                            "    ok_cancel;"                            "}"                        )                        (write-line line des)                    )                    (not (setq des (close des)))                    (< 0 (setq dcl (load_dialog tmp)))                    (new_dialog "blockpreview" dcl)                )            )            (princ "\nUnable to load dialog.")        )        (   t            (start_list "lst")            (foreach x lst (add_list x))            (end_list)             (set_tile "lst" "0")            (setq bln (nth 0 lst))            (_blockpreview (car lst))             (action_tile "lst" "(_blockpreview (setq bln (nth (atoi $value) lst)))")            (action_tile "accept" "(progn(_ins bln)(done_dialog 1))")            (action_tile "cancel" "(done_dialog 0)")            (start_dialog)        )    )    (*error* nil)) 

Navigation

[0] Message Index

[#] Next page

Go to full version