0 Members and 1 Guest are viewing this topic.
When you know what block you are going to insert, then you can check the blocks definition in the blocks collection, step through it, and find all the objects that are blocks, and then redefine them before you insert.
Quote from: T.Willey on April 10, 2006, 02:38:48 PMWhen you know what block you are going to insert, then you can check the blocks definition in the blocks collection, step through it, and find all the objects that are blocks, and then redefine them before you insert.do you think that is the easiest and best way ?
(defun c:wmd (/ a b c d X) (SETQ X (CADDDR (NENTSEL "WBLOCK DEEP PICKS"))) (FOREACH Q X (setq a(strcat(cdr (assoc 2 (entget Q))) "") b(getfiled "update" a "dwg" 9)) (command "WBLOCK" b a(terpri)))(TERPRI) )
(defun c:Nud (/ a b c d X) (SETQ X (CADDDR (NENTSEL "DEEP PICKS"))) (FOREACH Q X (setq a(strcat(setq b(cdr (assoc 2 (ENTGET Q)))) "=" (setq c (getfiled "update" b "dwg" 8)) ) C (IF(=(substr C 2 1)":") (PRINC (substr C (1+ (strlen(getvar "dwgprefix"))))) (PRINC C)) d (- (strlen c) 4) c (substr c 1 d) ) (command "insert" a(terpri))(entupd q))(TERPRI) )