REMOVE background mask from all block attributes?

REMOVE background mask from all block attributes?

matthew_neesley
Collaborator Collaborator
1,263 Views
2 Replies
Message 1 of 3

REMOVE background mask from all block attributes?

matthew_neesley
Collaborator
Collaborator

Hello all:

 

The code I have here adds a background mask to ALL blocks attributes in a dwg...now I have colleagues who need it REMOVED.  I've tried changing the "Background Fill Setting" from 3 to 0  but that doesn't work.  ***text colored magenta***

 

I found some evidence thru online searching that indicates an AutoCAD "bug" might prevent what I want from happening.  Is that still currently true?  Here's my code for ADDING the block attribute masks:

 

;;************************* { ADD BACKGROUND MASK TO ATTRIBUTE } ****************************;;
;; ;;
;; ------------------ Designed & Created by Satish Rajdev ------------------ ;;
;; ;;
;; ------------------ Command to Invoke = "ABMA" ------------------ ;;
;; ;;
;;********************************************************************************************;;

(defun c:abma (/ a b c)
(if (setq a (ssget '((0 . "insert") (66 . 1))))
; Select blocks which has attributes
(progn
(setq c (getvar 'cmdecho))
(setvar 'cmdecho 0)
(repeat (setq i (sslength a))
(setq b (vlax-ename->vla-object (ssname a (setq i (1- i)))))
; Get block from selection set 1 by 1 here
(mapcar ; trace all attributes which block has
'(lambda (x / x1)
(setq x1 (entget (vlax-vla-object->ename x)))
; convert VL-object to autolisp object
(if (member '(101 . "Embedded Object") x1)
; check attirbutes has embedded function added
(entmod
(append
(vl-remove-if
(function (lambda (y)
(member (car y) '(45 63 90 421 431 441))
)
)
x1
)
(list (cons 90 3) ; <- Background Fill Setting (0=Background off, 1= Use background fill color, 2 = Use drawing background as fill color
(cons 63 256) ; <- Change background fill color according to color index here
(cons 45 1.125) ; <- Border Offset Factor
(cons 441 0)
)
)
) ; add this DXF codes for filling background mask
)
)
(vlax-invoke b 'getattributes); get list of attributes of block
)
(command-s "_.draworder" (vlax-vla-object->ename b) "" "_f")
)
(setvar 'cmdecho c)
)
)
(princ)
)
(vl-load-com)
(princ)
(princ
(strcat
"\n:: Add Background Mask to Attribute.lsp ::"
"\n:: Created by Satish Rajdev | "
(menucmd "M=$(edtime,$(getvar,date),DDDD\",\" D MONTH YYYY)"
)
" ::"
"\n:: Type \"ABMA\" to Invoke ::"
)
)
(princ)

0 Likes
1,264 Views
2 Replies
Replies (2)
Message 2 of 3

pbejse
Mentor
Mentor

@matthew_neesley wrote:

I found some evidence thru online searching that indicates an AutoCAD "bug" might prevent what I want from happening.  Is that still currently true?  Here's my code for ADDING the block attribute masks:

If you added the attribute masks via lisp, Atsync will revert it back to its orignal state.

Like you said, it could be a bug. I'll take you word for it 🙂

 

 

0 Likes
Message 3 of 3

ronjonp
Advisor
Advisor

I think you're going to have to use attsync to remove them. The multiline text attrib does not have a backgroundfill property to turn off.

0 Likes