I am running CARLSONv2012|iCAD6.6 and would like to know how to make my text "mask" the line work behind it... like in aCAD. Should I explain more or is that good enough?
Is this possible?
Moderator: Carlson Support
;;; File: MTB.lsp
;;;
;;; Test adding a background mask to existing MTEXT with Intellicad 7.1
(defun MTBERR ( msg / )
(if (not (member msg '("console break" "Function Cancelled")))
(princ (strcat "\nError: " msg "\n")) ;print message
)
(command "_undo" "_back")
(setq *error* nss:*oe*
nss:*oce* NIL
nss:*oe* NIL
)
)
(defun C:MTBON ( / ed bw)
(setq nss:*oe* *error*)
(setq *error* MTBERR)
(setq nss:*oce* (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command "undo" "m")
(prompt "Turning background mask on for MText: ")
(setq ss (ssget '((0 . "MTEXT"))))
(initget 7)
(setq bw (getreal "Enter background mask scale: "))
(setq len (sslength ss)
i 0
)
(repeat len
(setq ed (entget (ssname ss i)))
;; make sure required dxf codes are in association list and set value
(mapcar
'(lambda(x)
(if (not (assoc (car x) ed))
(setq ed (append ed (list x)))
(setq ed (subst x (assoc 90 ed) ed))
)
)
(list
'(90 . 3) ; 1 (bkg fill on) + 2 (dwg wind colour) = 3
(cons 45 bw) ; fill box scale (1 = mtext box size)
)
)
(entmod ed)
(setq i (1+ i))
)
(setvar "cmdecho" nss:*oce*)
(setq *error* nss:*oe*
nss:*oce* NIL
nss:*oe* NIL
)
(gc)
(princ)
)
(defun C:MTBOFF ( / ed)
(setq nss:*oe* *error*)
(setq *error* MTBERR)
(setq nss:*oce* (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command "undo" "m")
(prompt "Turning background mask off for MText: ")
(setq ss (ssget '((0 . "MTEXT"))))
(setq len (sslength ss)
i 0
)
(repeat len
(setq ed (entget (ssname ss i)))
(if (assoc 90 ed)
(progn
(setq ed (subst (cons 90 0) (assoc 90 ed) ed))
(entmod ed)
)
)
(setq i (1+ i))
)
(setvar "cmdecho" nss:*oce*)
(setq *error* nss:*oe*
nss:*oce* NIL
nss:*oe* NIL
)
(gc)
(princ)
)
Users browsing this forum: Google [Bot]