;; | --------------------------------------------------------------------------- ;; | BL_UpdateBlkClr ;; | --------------------------------------------------------------------------- ;; | Function : Update block definition and all instances with a specified color ;; | Arguments: ;; | 'blk' - Name of block to update ;; | 'Clr' - Color to set for all objects of block ;; | Action : Updates the block definition and replaces all instances of the ;; | block with the new color ;; | Updated : March 6, 2006 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | --------------------------------------------------------------------------- (defun BL_UpdateBlkClr ( blk Clr / elast OS ss ) (setq blk (strcase blk)) (if (not (tblsearch "BLOCK" blk)) (progn (alert (strcat "Cannot find block definition in drawing : " blk)) (exit) )) (setq OS (getvar "OSMODE")) (setvar "OSMODE" 0) (setq elast (MI_xentlast)) (command "._Insert" (strcat "*" blk) (list 0.0 0.0 0.0) 1.0 0.0) (setq ss (MI_after elast)) (if ss (command "._ChProp" ss "" "_Color" Clr "") ) (setvar "EXPERT" 4) (command "._Block" blk (list 0.0 0.0 0.0) ss "") (setvar "EXPERT" 0) (setvar "OSMODE" OS) )