+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Senior Member
    Using
    AutoCAD 2009
    Join Date
    Jul 2009
    Posts
    259

    Default Text mask wipeout replacement by background mask

    Registered forum members do not see this ad.

    Hi, Everyone...

    I am wondering if someone is available to work this one out..

    We all know testmask in autocad does a great job masking all selected text and mtext, It produces wipeouts and groups each text with its own wipeout... we can even re-assign a wipeout to each text object using textmask when the text is modified, the problem appears when we copy /paste those objects to another drawing, the group dissapears and the wipeout remains... then we need to delete them or modify the text..

    So, a nice background mask toggle routine was made by our partner Alan, another masking routine has been developed by Lee Ambrosius, but they will work for mtext only, and then I got another routine to convert text to individual mtext objects... (I got some routines for this case, but attached one is the one worked best for me, which uses express tools, actually)

    So, I would like to combine Lee Ambrosius routine with Text to Mtext converting routine so I will be able to select text and mtext at once, and then this new routine will convert selected text to mtext and then now those mtext objects will be added to original selection and all of them will get a background mask of 1.2 with background color.

    That way we'll have the textmask command replaced by this new routine. the best thing of this one will be that when you modify any text, the mask will follow it, and when you copy /paste any of those texts, the mask will not be detached.

    is there Anyone who can try to merge TTM2 into MTM for a One Step routine?

    Also, I found another small lisp (TM4) that does exactly what I need on selected Mtext objects... It adds a backgroung mask to selected mtext objects, using background color and offset =1.15, (I added the background color option). it also brings previously selected objects to front. It will be easier to modify adding the convert text lisp.
    -----------------------------------------------------------------
    Now I got some help from Charles Butler... he fixed a lisp to convert text objects to mtext objects individually... It's better than previous lisp I used, cause this one doesn´t need express tools, and works even better when defining the four control points or grips for each text converted to mtext...

    So I replaced it in the attached files
    Attached Files
    Last edited by gilsoto13; 5th Dec 2009 at 07:32 pm.

  2. #2
    Senior Member
    Using
    AutoCAD 2009
    Join Date
    Jul 2009
    Posts
    259

    Default

    Oook, I got some help in another forum and doing some research by myself... so I got this approach... and I like the way it works now... I was dealing on how to add a background fill to dimensions, and I decided just to set Dimtfill =1 and update dimensions to current style..( that work for us).
    Another thing I was struggling with is the convertion from text to mtext, so I decided to stick with a lisp to convert them using the txt2mtxt command from the express tools, that one seemed to be the most reliable one, other lisps were usually deleting text, also this lisp was setting mtext such way that changed one row text into 2 row text, so I wanted to set width= 0, then I grabbed a lisp from Alan J. Thompson as function to changed them to width= 0, and that is all..

    So, It works perfect now for me, but I am still looking for some help to skip selecting all the objects 3 times, and make one selection only... and also would be better to add an UNDO group code to make it easy to undo all just in case...but well.. at least this is a good start for me.

    Code:
    ;TM9.lsp
    ;This routine will set a background color fill to all selected text, 
    ;mtext and dimensions, will update dimensions to current Dimstyle with 
    ;Dimtfill set to 1 temporarily for this purpose, so works for current 
    ;Dimscale only, text objects will be converted to mtext with width=0
    ;It will bring objects in layer 'Dims' to front at the end
    ;
    ; Some part of code from Tom Beauford, from AUGI
    ;http://forums.augi.com/showthread.php?t=77962
    ; Turns Background mask on text, mtext and dimensions
    ; Set 'Border Offset Factor' to 1.15
    (vl-load-com) 
    (defun c:tm9 (/ ss1 num cnt obj ent)
      (setvar "dimtfill" 1)
        (W0)
        (ttm2)
        (prompt "\nSelect all text to apply the background fill...: ")
        (setq ss1 (ssget '((0 . "mtext")))
        num (sslength ss1)
        cnt 0)
      (repeat num
          (setq obj (vlax-ename->vla-object (ssname ss1 cnt)))
              (vlax-put-property obj 'BackgroundFill :vlax-true)
              (setq ent (vlax-vla-object->ename obj)
                    elist (entget ent)
                    elist (subst (cons 45 1.15)(assoc 45 elist) elist)
                    elist (subst (cons 421 256)(assoc 421 elist) elist)
       )
              (entmod elist)
          (setq cnt (1+ cnt))
      ); repeat
        (setq sel1 (ssget "x" '((8 . "Dims,G-Dims,M-Dims,E-Dims,S-Dims,P-Dims"))))
        (setq sel2 (ssget "x" '((0 . "*Dimension*"))))
        (setq sel3 (ssget "x" '((0 . "*Dimension*"))))
      (vl-cmdf "_dimstyle" "apply" sel2 "")
      (vl-cmdf "_draworder" sel3 "" "f")
      (vl-cmdf "_draworder" ss1 "" "f")
      (vl-cmdf "_draworder" sel1 "" "f")
      (princ)
    )
     
    ;;Using code from robierzogg from HISPACAD
    ;;http://www.hispacad.com/foro/viewtopic.php?p=142823&sid=b23c3147d2a06a29d1dfd60078f79c08
    ;;;This routine works only if Express tools are installed
    ;;; Convert selected text into Mtext 
    (defun ttm2 (/ conj n nombre_n pto_insercion nombre_n1 nuevlista) 
      (prompt "\nSelect all text and dimensions...: ") 
      (SETQ conj (ssget '((0 . "TEXT"))) ) 
      (setq n 0) 
      (REPEAT (sslength conj) 
        (setq nombre_n (ssname conj n)) 
        ;Hallamos el punto de inserción 
        (setq pto_insercion (assoc 10 (entget nombre_n))) 
        ;Convert Text to Mtext, using the EXPRESS command
        (command "txt2mtxt" nombre_n "") 
        ;We set their original insertion point 
        (setq nombre_n1 (entlast)) 
        (SETQ nuevlista (SUBST pto_insercion (ASSOC 10 (ENTGET nombre_n1))(ENTGET nombre_n1))) 
        (ENTMOD nuevlista) 
        (SETQ nuevlista (SUBST '(71 . 7) (ASSOC 71 (ENTGET nombre_n1))(ENTGET nombre_n1))) 
        (ENTMOD nuevlista) 
        (setq n (1+ n)) 
      ) 
    )
    ;set width for mtext to zero and defined height to zero 
    ;Alan J. Thompson
    ;http://www.cadtutor.net/forum/showthread.php?t=25412
    (defun W0 (/ tmp ss lst EntData) 
        (princ "\nSelect all converted text to remove previously assigned width..: ")
      (setq ss (ssget '((0 . "MTEXT")))) 
      (setq lst (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))) 
      (mapcar '(lambda (x) 
                 (setq EntData (entget x)) 
             (setq tmp (subst (cons 46 0.0) (assoc 46 EntData) EntData)) 
                 (entmod (subst (cons 41 0.0) (assoc 41 EntData) tmp)) 
               ) 
              lst 
      ) 
    ;  (command ".regen") 
      (princ) 
    )
    Weell,

    Finally Alan made this little dream come true, here is the final routine to apply a background fill to selected text, mtext and dimensions
    ------------------------------------

    Edited: I added an Undo Group (my first time) and also a draworder operation to move everytyhing to the Back so changed mtext will be shown above everything (after you regen manually).. some extra draworder operation are in the code for our office needs.

    Code:
    ;;; ;BA.lsp  -BACKGROUND FILL ALL-
    ;;; ;Made for M3 Mexicana. December 2009
    ;;; ;This routine will set a background color fill to all selected text, 
    ;;; ;mtext and dimensions, it will update dimensions to current Dimstyle with 
    ;;; ;Dimtfill set to 1 temporarily for this purpose, so it works for current 
    ;;; ;Dimscale only, text objects will be converted to mtext with width=0
    ;;; ;It will bring objects in layer 'Dims' to front at the end
    ;;; ;Reviewed and modified by: Alan J. Thompson. 
    ;;;
    ;;; ; Some part of code from Tom Beauford, from AUGI
    ;;; ;http://forums.augi.com/showthread.php?t=77962
    ;;; ; Set 'Border Offset Factor' to 1.15
    (vl-load-com)
    (defun c:BA (/ *error* ttm2 ss elist sel1 sel3 dimt)
    ;;; error handler
      (defun *error* (#Message)
        (and dimt (setvar "dimtfill" dimt))
        (and #Message
             (not (wcmatch (strcase #Message) "*BREAK*,*CANCEL*,*QUIT*"))
             (princ (strcat "\nError: " #Message))
        ) ;_ and
      ) ;_ defun
    ;;Using code from Roberto Gonzalez -robierzogg- from HISPACAD
    ;;http://www.hispacad.com/foro/viewtop...dfd60078f79c08
    ;;;This routine works only if Express tools are installed
    ;;; Convert selected text into Mtext 
    (command "undo" "begin")  ;beginning of undo group
      (defun ttm2 (name_n / collect n name_n insertpt name_n1 newlist)
        (setq insertpt (assoc 10 (entget name_n)))
     ;Convert Text to Mtext, using the EXPRESS command
        (command "txt2mtxt" name_n "")
     ;We set their original insertion point here
        (setq name_n1 (entlast))
        (SETQ newlist (SUBST insertpt (ASSOC 10 (ENTGET name_n1)) (ENTGET name_n1)))
        (ENTMOD newlist)
        (SETQ newlist (SUBST '(71 . 7) (ASSOC 71 (ENTGET name_n1)) (ENTGET name_n1)))
        (ENTMOD newlist)
        (SETQ newlist (SUBST '(46 . 0) (ASSOC 46 (ENTGET name_n1)) (ENTGET name_n1)))
        (ENTMOD newlist)
        (SETQ newlist (SUBST '(41 . 0) (ASSOC 41 (ENTGET name_n1)) (ENTGET name_n1)))
        (ENTMOD newlist)
      ) ;_ defun
      (setq dimt (getvar "dimtfill"))
      (setvar "dimtfill" 1)
      (princ "\nSelect Dimensions and text to apply the background fill and update...: ")
      (and (setq ss (ssget "_:L" '((0 . "MTEXT,*DIMENSION*,TEXT"))))
           (foreach x (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
             (cond
               ((eq "MTEXT" (cdr (assoc 0 (setq elist (entget x)))))
                (vla-put-backgroundfill (vlax-ename->vla-object x) :vlax-true)
                (setq elist (subst (cons 41 0.0) (assoc 41 elist) elist)
                      elist (subst (cons 46 0.0) (assoc 46 elist) elist)
                      elist (subst (cons 45 1.15) (assoc 45 elist) elist)
                      elist (subst (cons 421 256) (assoc 421 elist) elist)
                ) ;_ setq
                (entmod elist)
               )
               ((eq "TEXT" (cdr (assoc 0 (entget x))))
                (ttm2 x)
                (ssdel x ss)
                (vla-put-backgroundfill (vlax-ename->vla-object (setq elist (entlast))) :vlax-true)
                (ssadd elist ss)
                (setq elist (entget elist))
                (setq elist (subst (cons 45 1.15) (assoc 45 elist) elist)
                      elist (subst (cons 421 256) (assoc 421 elist) elist)
                ) ;_ setq
                (entmod elist)
               )
               (T T)
             ) ;_ cond
           ) ;_ foreach
           (vl-cmdf "_.-dimstyle" "_apply" ss "")
           (vl-cmdf "_.draworder" ss "" "_f")
      ) ;_ and
      (if (setq sel5 (ssget "_X" '((0 . "INSERT")(2 . "CENTER LINE2,COLUMN ROW BUBBLE2,DETAIL BUBBLE 12,DETAIL BUBBLE2,DUST PICK UP POINT2,EQUIPMENT TAG2,FULL SECTION LR2,FULL SECTION UD2,FULL SECTION2,MATCH LINE SP2,MATCH LINE2,NORTH ARROW2,NOTE BOX2,NOTE ENCL2,PARTIAL SECTION T2,PARTIAL SECTION2,PLATE2,REVISION2,SAMPLE NUMBER2,SECTION CUT UD2,SECTION CUT2,STAMP BIG2,STAMP SMALL2,STREAM NUMBER2,STREAM SEQUENCE2,TAG2,TITLE 12,TITLE BUBBLE 12,TITLE BUBBLE2,TITLE2,WORK POINT2,ROOMTAG,ROOMTAG2,DOORTAG,WALLTAG,WINDOWTAG,MULTIPLE DETAIL,IND WALL CEIL 1, IND WALL UP 1, IND WALL L 1, IND WALL R 1, IND WALL DN 1"))))
        (vl-cmdf "_.draworder" sel5 "" "_f")
      ) ;_ if
      (if (setq sel4 (ssget "_X" '((0 . "line,lwpolyline,insert,polyline,arc,circle,spline,hatch,region"))))
        (vl-cmdf "_.draworder" sel4 "" "_b")
      ) ;_ if
      (if (setq sel1 (ssget "_X" '((0 . "leader,*Dimension*"))))
        (vl-cmdf "_.draworder" sel1 "" "_f")
      ) ;_ if
      (if (setq sel3
                 (ssget "_X"
                        '((0 . "line,lwpolyline,polyline")
                          (8 . "Dims,Ar-Dims,G-Dims,M-Dims,E-Dims,S-Dims,P-Dims")
                         )
                 ) ;_ ssget
          ) ;_ setq
        (vl-cmdf "_.draworder" sel3 "" "_f")
      ) ;_ if
      (setvar "dimtfill" dimt)
      (princ)
    (command "undo" "end")  ;end of undo group
    ) ;_ defun
    (princ
      "\Type \"BA\" to mask all text, mtext and dimensions at once."
    )
    (princ
      "\Remember to set dimscale according to selected dimensions before using it."
    )
    A guy in the autodesk forum asked for multileaders to be added to this lisp.... but Couldn´t even make it work for them.... anyway, it works perfect for us as it is.

    Thanks Alan... you da man
    Attached Files
    Last edited by gilsoto13; 4th Oct 2011 at 02:52 pm.

  3. #3
    Senior Member
    Using
    AutoCAD 2009
    Join Date
    Jul 2009
    Posts
    259

    Default

    Another version of this lisp will add the grips or control points to selected mtext, thanks to Rogerio Brazil for his code to set mtext box to objects and to Marco Jacinto from hispacad for adding this code.
    I added a tolerance to mtext width to avoid automatic changing width several times when using the routine.

    Code:
    ;;; ;BA.lsp  -BACKGROUND FILL ALL-
    ;;; ;Made for M3 Mexicana. Coding Selected by Paulo Gil. December 2009
    ;;; ;This routine will set a background color fill to all selected text, 
    ;;; ;mtext and dimensions, it will update dimensions to current Dimstyle
    ;;; with
    ;;; ;Dimtfill set to 1 temporarily for this purpose, so it works for current 
    ;;; ;Dimscale only, text objects will be converted to mtext with width=0
    ;;; ;and then will add their text box control points
    ;;; ;It will bring objects in layer 'Dims' to front at the end, as well as other
    ;;; ;Draworder operations according to M3 standards.
    ;;; ;Reviewed and modified by: Alan J. Thompson. 
    ;;; ;And Marco Antonio Jacinto Perez 
    ;;; ;December 2009
    ;;;
     
    (VL-LOAD-COM)
    (DEFUN c:BA (/ *error* ttm2 ss elist sel1 sel3 dimt)
    ;;; error handler
      (DEFUN *error* (#Message)
        (AND dimt (SETVAR "dimtfill" dimt))
        (AND #Message
      (NOT (WCMATCH (STRCASE #Message) "*BREAK*,*CANCEL*,*QUIT*"))
      (PRINC (STRCAT "\nError: " #Message))
        ) ;_ and
      ) ;_ defun
    ;; Using code from Roberto Gonzalez -robierzogg- from HISPACAD
    ;; http://www.hispacad.com/foro/viewtopic.php?p=142823&sid=b23c3147d2a06a29d1dfd60078f79c08
    ;; This routine works only if Express tools are installed
    ;; Convert selected text into Mtext 
     
      (COMMAND "undo" "begin")  ;beginning of undo group
      (DEFUN ttm2 (name_n / collect n name_n insertpt name_n1 newlist)
        (SETQ insertpt (ASSOC 10 (ENTGET name_n)))
         ; Convert Text to Mtext, using the
         ; EXPRESS
         ; command
        (COMMAND "txt2mtxt" name_n "")
         ; We set their original insertion point
         ; here
    ;;;creo que esta parte mueve los nuevos mtextos de posicion hacia arriba
    ;;;no se por que lo pusieron?
        (SETQ name_n1 (ENTLAST))
        (SETQ newlist (SUBST insertpt
        (ASSOC 10 (ENTGET name_n1))
        (ENTGET name_n1)
        )
        )
        (ENTMOD newlist)
        (SETQ newlist (SUBST '(71 . 7)
        (ASSOC 71 (ENTGET name_n1))
        (ENTGET name_n1)
        )
        )
        (ENTMOD newlist)
        (SETQ newlist (SUBST '(46 . 0)
        (ASSOC 46 (ENTGET name_n1))
        (ENTGET name_n1)
        )
        )
        (ENTMOD newlist)
        (SETQ newlist (SUBST '(41 . 0)
        (ASSOC 41 (ENTGET name_n1))
        (ENTGET name_n1)
        )
        )
        (ENTMOD newlist)
      ) ;_ defun
     
    ;;; Aqui pongo la variable Mtexts como un parametro, el cual corresponde al ss
    ;;; que vas creando con los nuevos Mtextos
      (DEFUN mw5 (mtexts / mtexts idx ename EntData dxf42 dxf43 EntData1)
         ;Reset Width - Mtext
        (IF mtexts
    ;; Aqui se hace el cambio para que en lugar
    ;; de cambiar todos los mtextos, solo modifique los que recien creaste
    ;; (setq mtexts (ssget "_X" '((0 . "MTEXT"))))
    ;; Rogerio Brazil from an autodesk Discussion groups
    ;; http://discussion.autodesk.com/forums/thread.jspa?messageID=6339167&tstart=0
          (PROGN
     (SETQ idx 0)
     (REPEAT (SSLENGTH mtexts)
       (SETQ ename (SSNAME mtexts idx))
       (SETQ EntData (ENTGET ename '("*")))
       (SETQ dxf42 (* (CDR (ASSOC 42 EntData))1.07))
       (SETQ dxf43 (CDR (ASSOC 43 EntData)))
       (SETQ EntData1
       (ENTMOD (SUBST (CONS 41 dxf42) (ASSOC 41 EntData) EntData))
       )
       (ENTMOD (SUBST (CONS 46 dxf43) (ASSOC 46 EntData1) EntData1)
       )
       (SETQ idx (1+ idx))
     )    ;progn
          )     ;repeat
          (PRINC "\n Null Selection!")
        )     ;if
        (PRINC)
      )
     
    ;;
    ;;
    ;;    ; MAIN ROUTINE
    ;;
    ;;
    ;; Some part of code from Tom Beauford, from AUGI
    ;; http://forums.augi.com/showthread.php?t=77962
    ;; Set 'Border Offset Factor' to 1.15
     
      (SETQ dimt (GETVAR "dimtfill"))
      (SETVAR "dimtfill" 1)
      (PRINC
        "\nSelect Dimensions and text to apply the background fill and update...: "
      )
      (AND (SETQ ss (SSGET "_:L" '((0 . "MTEXT,*DIMENSION*,TEXT"))))
           (FOREACH x (VL-REMOVE-IF 'LISTP (MAPCAR 'CADR (SSNAMEX ss)))
      (COND
        ((EQ "DIMENSION" (CDR (ASSOC 0 (SETQ elist (ENTGET x)))))
         (VLA-PUT-TEXTFILL
           (VLAX-ENAME->VLA-OBJECT x)
           :VLAX-TRUE
         )
         (ENTMOD elist)
        )
        ((EQ "MTEXT" (CDR (ASSOC 0 (SETQ elist (ENTGET x)))))
         (VLA-PUT-BACKGROUNDFILL
           (VLAX-ENAME->VLA-OBJECT x)
           :VLAX-TRUE
         )
         (SETQ elist (SUBST (CONS 41 0.0) (ASSOC 41 elist) elist)
        elist (SUBST (CONS 46 0.0) (ASSOC 46 elist) elist)
        elist (SUBST (CONS 45 1.15) (ASSOC 45 elist) elist)
        elist (SUBST (CONS 421 256) (ASSOC 421 elist) elist)
         ) ;_ setq
         (ENTMOD elist)
        )
        ((EQ "TEXT" (CDR (ASSOC 0 (ENTGET x))))
         (ttm2 x)
         (SSDEL x ss)
         (VLA-PUT-BACKGROUNDFILL
           (VLAX-ENAME->VLA-OBJECT (SETQ elist (ENTLAST)))
           :VLAX-TRUE
         )
         (SSADD elist ss)
         (SETQ elist (ENTGET elist))
         (SETQ elist (SUBST (CONS 45 1.15) (ASSOC 45 elist) elist)
        elist (SUBST (CONS 421 256) (ASSOC 421 elist) elist)
         ) ;_ setq
         (ENTMOD elist)
        )
        (T T)
      ) ;_ cond
           ) ;_ foreach
           (VL-CMDF "_.-dimstyle" "_apply" ss "")
           (VL-CMDF "_.draworder" ss "" "_f")
      ) ;_ and
    (setq 
        BkLst 
               '("CENTER LINE2"   "COLUMN ROW BUBBLE2"  "DETAIL BUBBLE 12" 
                 "DETAIL BUBBLE2"     "DUST PICK UP POINT2"     "EQUIPMENT TAG2" 
                 "FULL SECTION LR2"     "FULL SECTION UD2"     "FULL SECTION2"  
                 "MATCH LINE SP2"     "MATCH LINE2"     "NORTH ARROW2"     
                 "NOTE BOX2"     "NOTE ENCL2"     "PARTIAL SECTION T2"     
                 "PARTIAL SECTION2"     "PLATE2"     "REVISION2"     
                 "SAMPLE NUMBER2"     "SECTION CUT UD2"     "SECTION CUT2"     
                 "STAMP BIG2"     "STAMP SMALL2"     "STREAM NUMBER2"     
                 "STREAM SEQUENCE2"     "TAG2"     "TITLE 12"     
                 "TITLE BUBBLE 12"     "TITLE BUBBLE2"     "TITLE2"     
                 "WORK POINT2"     "ROOMTAG"     "ROOMTAG2"     "DOORTAG"     
                 "WALLTAG"     "WINDOWTAG"     "MULTIPLE DETAIL"     
                 "IND WALL CEIL 1"     "IND WALL UP 1"     "IND WALL L 1"  
                 "IND WALL R 1"     "IND WALL DN 1"     "MULTIPLE DETAIL"
            ) 
        NomBloques (car BkLst) 
        BkName     (mapcar '(lambda    (x) 
                  (setq NomBloques (strcat NomBloques "," x)) 
                ) 
                   (cdr BkLst) 
               ) 
      ) 
      (if (setq sel5 (ssget "_X" (list '(-4 . "<OR") 
                        ; _Se seleccionan todos los bloques de 
                        ; usuario, despues se procesaran los 
                        ; nombres esto para poder procesar los 
                        ; bloques dinamicos 
                       '(-4 . "<AND") 
                       '(0 . "INSERT") 
                       (cons 2 (strcat NomBloques ",`*U*")) 
                       '(-4 . "AND>") 
                       '(-4 . "OR>") 
                 ) 
              ) 
          ) 
     
        (VL-CMDF "_.draworder" sel5 "" "_f")
      ) ;_ if
      (IF (SETQ sel4
          (SSGET
            "_X"
            '((0
        .
        "line,lwpolyline,insert,polyline,arc,circle,spline,hatch,region"
       )
      )
          )
          )
        (VL-CMDF "_.draworder" sel4 "" "_b")
      ) ;_ if
      (IF (SETQ sel1 (SSGET "_X" '((0 . "leader,*Dimension*"))))
        (VL-CMDF "_.draworder" sel1 "" "_f")
      ) ;_ if
      (IF (SETQ sel3
          (SSGET "_X"
          '((0 . "line,lwpolyline,polyline")
            (8 . "Dims,Ar-Dims,G-Dims,M-Dims,E-Dims,S-Dims,P-Dims")
           )
          ) ;_ ssget
          ) ;_ setq
        (VL-CMDF "_.draworder" sel3 "" "_f")
      ) ;_ if
      (SETVAR "dimtfill" dimt)
      (PRINC)
      (COMMAND "undo" "end")  ;end of undo group
      (mw5 ss)
    ) ;_ defun
    (PRINC
      "\Type \"BA\" to mask all text, mtext and dimensions, adding mtext box"
    )
    (PRINC
      "\Remember to set dimscale according to selected dimensions before using it."
    )
     
    ;|«Visual LISP© Format Options»
    (80 2 40 2 nil "end of " 60 9 2 0 0 T T T T)
    ;*** DO NOT add text below the comment! ***|;
    Last edited by gilsoto13; 4th Oct 2011 at 02:51 pm.

  4. #4
    Banned athabe's Avatar
    Computer Details
    athabe's Computer Details
    Operating System:
    Linux and Window 7
    Using
    AutoCAD 2009
    Join Date
    Oct 2011
    Posts
    8

    Default

    for tm4.lsp can we get an addition to that routine to force Mtext defined width to zero

    Thanks

  5. #5
    Senior Member
    Using
    AutoCAD 2009
    Join Date
    Jul 2009
    Posts
    259

    Default

    Quote Originally Posted by athabe View Post
    for tm4.lsp can we get an addition to that routine to force Mtext defined width to zero

    Thanks
    I am not a lisp programming guy... but that would be easy to do... this is a very dirty way...I guess.

    Code:
    ; Turns Background mask on
    ; Set 'Border Offset Factor' to 1.15
    (defun c:tm4x (/ ss1 num cnt obj ent)
      (setq ss1 (ssget '((0 . "mtext")))
        num (sslength ss1)
        cnt 0)
      (repeat num
          (setq obj (vlax-ename->vla-object (ssname ss1 cnt)))
              (vlax-put-property obj 'BackgroundFill :vlax-true)
              (setq ent (vlax-vla-object->ename obj)
                    elist (entget ent)
                    elist (subst (cons 45 1.15)(assoc 45 elist) elist)
                    elist (subst (cons 421 256)(assoc 421 elist) elist)
       )
              (entmod elist)
          (setq cnt (1+ cnt))
      ); repeat
    (W0)
      (vl-cmdf "_draworder" ss1 "" "f")
      (princ)
    )
    
    ;set width for mtext to zero and defined height to zero 
    (defun W0 (/ tmp ss lst EntData) 
      (setq lst (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss1)))) 
      (mapcar '(lambda (x) 
                 (setq EntData (entget x)) 
             (setq tmp (subst (cons 46 0.0) (assoc 46 EntData) EntData)) 
                 (entmod (subst (cons 41 0.0) (assoc 41 EntData) tmp)) 
               ) 
              lst 
      ) 
    ;  (command ".regen") 
      (princ) 
    )

  6. #6
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2011
    Join Date
    Apr 2008
    Posts
    6,000

    Default

    Seriously dude, PLEASE take my email out of your post(s).
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  7. #7
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x86
    CPU:
    Pentium(R) Dual-Core CPU E5500 @ 2.80GHz
    RAM:
    4 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    ThinkVision 22"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2011
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    9,106

    Default

    Quote Originally Posted by alanjt View Post
    Seriously dude, PLEASE take my email out of your post(s).
    Your email is also in the one at AUGI that you posted. Is he not suppossed to leave it intact?
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  8. #8
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2011
    Join Date
    Apr 2008
    Posts
    6,000

    Default

    Quote Originally Posted by SLW210 View Post
    Your email is also in the one at AUGI that you posted. Is he not suppossed to leave it intact?
    Arg, if I posted it, it was by accident.
    Linky?
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  9. #9
    Banned athabe's Avatar
    Computer Details
    athabe's Computer Details
    Operating System:
    Linux and Window 7
    Using
    AutoCAD 2009
    Join Date
    Oct 2011
    Posts
    8

    Default

    Well done gilsoto13 it works thanks

  10. #10
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2011
    Join Date
    Apr 2008
    Posts
    6,000

    Default

    Registered forum members do not see this ad.

    Thanks for removing gil
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

Similar Threads

  1. Background Mask
    By CADwench in forum AutoCAD General
    Replies: 3
    Last Post: 5th Dec 2007, 03:21 am
  2. Good Question: Text background mask
    By AutoCAD Insider in forum AutoCAD RSS Feeds
    Replies: 3
    Last Post: 10th Mar 2007, 05:33 pm
  3. Replies: 1
    Last Post: 14th Dec 2006, 04:00 pm
  4. Wipeout / Text Mask
    By Ragazzi in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 19th Jun 2006, 05:59 pm
  5. Background mask in dimension text
    By Dean07 in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 24th May 2006, 01:53 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts