Author Topic: looking for a lisp - text with mask  (Read 18998 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
looking for a lisp - text with mask
« on: July 13, 2005, 02:43:27 PM »
i am looking for a macro or perhaps a lisp that would allow me to select as many text objects as i want. next i want to apply a background mask to all text selected. then i would like to bring all selected objects to front via draworder. i am using 2006 and know about the text to front command but everyone else is using 2005. if anyone could help me out i'd really appreciate it.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
looking for a lisp - text with mask
« Reply #1 on: July 13, 2005, 02:57:06 PM »
i have something similiar you might be able to modify.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
looking for a lisp - text with mask
« Reply #2 on: July 13, 2005, 02:57:58 PM »
Code: [Select]
(defun wiper ()
  (if (ssget "x" '((0 . "WIPEOUT")))
    (progn
      (imback)
      (COMMAND "_.wipeout" "_f" "_ON")
      (COMMAND "-LAYER" "m" "WIPEOUT" "c" "RED" "WIPEOUT" "")
      (setq ss1 (ssget "x" '((0 . "WIPEOUT"))))
      (COMMAND "_CHANGE" "p" "" "p" "la" "WIPEOUT" "")
      (setq ss1   (ssget "x" '((0 . "WIPEOUT")))
   SS1LEN (sslength SS1)
   ENT1   T
   COUNT  0
      )
;COUNT 0   )
      (REPEAT SS1LEN
(setq ent1 (ssname ss1 COUNT))
(COMMAND "_IREGFROMVEC" ENT1)
(SETQ COUNT (1+ COUNT))
      )
      (SETQ SS1REMS (ssget "x" '((0 . "AECIDBREMPOLYREG"))))
      (COMMAND "ERASE" SS1REMS "")
      (setq ss1 (ssget "x" '((0 . "WIPEOUT"))))
      (COMMAND "ERASE" SS1 "")
    )
  )
)
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
looking for a lisp - text with mask
« Reply #3 on: July 13, 2005, 02:59:18 PM »
This was written to remove wipeouts and create removals in a raster image.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
looking for a lisp - text with mask
« Reply #4 on: July 13, 2005, 03:01:29 PM »
Im thinking you will need to pull the corners of the text box to define your wipeout.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
looking for a lisp - text with mask
« Reply #5 on: July 13, 2005, 03:02:19 PM »
Code: [Select]
(defun imback ()
  (setq ss1 (ssget "x" '((0 . "IMAGE"))))
  (COMMAND "DRAWORDER" SS1 "" "b")
)
 this was called in the first routine, and can be changed to send your text forward
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

ELOQUINTET

  • Guest
looking for a lisp - text with mask
« Reply #6 on: July 13, 2005, 03:07:16 PM »
mmm we have had problems with wipeouts in the past, people move the text and the frames get left behind so now that they have background mask it is the method we use for masking. i am trying to firgure out how to access the mask without manually doing it through properties or through mtext editor. i know you can setup a background mask in dimension styles but we use alot of old blocks which do not utilize this feature. i'm looking for a on the fly work around. i'll look at your code and see how much i can use. thanks

CADaver

  • Guest
looking for a lisp - text with mask
« Reply #7 on: July 13, 2005, 05:10:03 PM »
Express tools TEXTMASK, leave group select ON?

sourdough

  • Bull Frog
  • Posts: 367
you might also find this helpful.... these are some oldies
« Reply #8 on: July 14, 2005, 02:30:02 AM »
Here are a few of my retro oldies that still work great thru 2006

Code: [Select]

(defun c:tt () (setvar "pickstyle" 1)(c:textmask));shortcut that sets group text to mask



another oldie that will bring all mtext and text in the dwg to front

Code: [Select]

(defun C:MNA(/ mtext text pt1)
(setvar "cmdecho" 0)

  (setq mtext (ssget "X" ' ((0 . "MTEXT"))))
  (setq text (ssget "X" ' ((0 . "TEXT"))))

    (setq pt1 "0,0")
   
  (command "COPY" text "" pt1 pt1)
  (command "ERASE" "P" "")

  (command "COPY" mtext "" pt1 pt1)
  (command "ERASE" "P" "")

  (command "redraw")
  (setvar "cmdecho" 1)
)
LDC 2009/C3D 2010/C3D 2011/C3D 2016

Win 10 64bit

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
looking for a lisp - text with mask
« Reply #9 on: July 14, 2005, 07:47:41 AM »
dan
I updated your title so it would at least hint at the subject.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

ELOQUINTET

  • Guest
looking for a lisp - text with mask
« Reply #10 on: July 14, 2005, 09:17:52 AM »
thanks cab and everybody for your help. i haven't tried any of the ones you offered yet. I think i may have found one that does the job. here's what i found.

Code: [Select]
(defun C:MTMASK (/ MASK_LIST ENT SS)
;;(command "_.texttofront" "T")
;;(setq SS (ssget "x" '((0 . "mtext"))))
(setq ss (ssget))
(setq MASK_LIST
(list
(cons 90 3)
(cons 63 256)
(cons 45 1.5)
(cons 441 1616860)
)
N 0
)
(if SS
(repeat (sslength SS)
(setq ENT (entget (ssname SS N)))
(setq ENT (append ENT MASK_LIST))
(entmod ENT)
(setq N (1+ N))
)
)
(command "_.texttofront" "T")
(princ)
)

Hangman

  • Guest
looking for a lisp - text with mask
« Reply #11 on: July 19, 2005, 01:53:18 PM »
OK, this is in a very close proximity to my problem.  May I continue this line ???

I'm very intrigued by the lisp Eloquintet has posted here above.  I like the way it creates a mask around an mtext.  Now my question is, what type of mask is it and how is it taken off when no longer needed ???
Also, this leads into my masking a dimension string I have in the Vanilla side.  I tried the lisp above and have discovered that it does the same thing the mask does with the dimensions.  That is, it gives me a big black box when I plot the text to the printer.  How can I manipulate this ... whatever it is.  A text mask is a raster image so what is this ???

I am looking at creating a textmask lsp for masking dimensions because some of the users are exploding the dimension strings just to mask the text.  And I can't use the fillcolor in the dimension because it plots a black box.    To do, To do.   :?:

ELOQUINTET

  • Guest
looking for a lisp - text with mask
« Reply #12 on: July 19, 2005, 03:08:00 PM »
i don't know how it does it hangman but i do have an unmask lisp as well. as far as exploding dimensions to apply a background, why doesn't applying a background in the dimension style work. and whoever is exploding dimensions needs to be canned period a definite no no  :evil:

Code: [Select]
(defun C:UNMTMASK (/ SS N)
(vl-load-com)
(setq SS (ssget "x" '((0 . "mtext")))
N 0
)
(if SS
(repeat (sslength SS)
(vla-put-backgroundfill
(vlax-ename->vla-object (ssname SS N))
0
)
(setq N (1+ N))
)
)
(princ)
)

Hangman

  • Guest
looking for a lisp - text with mask
« Reply #13 on: July 19, 2005, 06:52:44 PM »
Eloquintet,
Thanks for the unmasking lsp, it'll help in my search for peace.   :)

Quote
as far as exploding dimensions to apply a background, why doesn't applying a background in the dimension style work.


When plotting, I get a black box instead of the text.  I've heard people saying that it works great but no one can explain how their system is setup so I can find an answer to this problem.  The users explode the dimension string so they have dtext, then they can put a textmask around it.  This masking you have here is for the mtext and it works identical to the background in the dimension style.  The textmask I am speaking of is in the express tools, it creates a raster image.

ELOQUINTET

  • Guest
looking for a lisp - text with mask
« Reply #14 on: July 20, 2005, 09:03:11 AM »
i guess you're talking about wipeout and i believe they had problems with that too here. i don't see why going into dimension style/text/fillcolor/background would not work for masking dimension text. then use the texttofront command. no black box here :?: