Looking for a short cut to turn dtexted to mtex, then add a 1.1 background mask

Looking for a short cut to turn dtexted to mtex, then add a 1.1 background mask

claimed4all
Advocate Advocate
519 Views
2 Replies
Message 1 of 3

Looking for a short cut to turn dtexted to mtex, then add a 1.1 background mask

claimed4all
Advocate
Advocate

I am currently looking for a way to take DTEXT and convert to MTEXT, and apply a 1.1 background mask to the text.

 

I can modify a lisp now and again, but no idea where to start on that.

 

So I treid to do this with the action recorder, which i have had great luck with on several routines I have created with it.

 

I can get the DTEXT to convert to MTEXT, and then pull up the background mask properties box.  Thats as far as I can get.

 

I can not get "Use Background Mask" to be checked, a 1.1 offset entered, "Use Drawing Background" to be checked and then OK clicked.

 

Any idea how to make this work for me?

 

 

0 Likes
Accepted solutions (1)
520 Views
2 Replies
Replies (2)
Message 2 of 3

hmsilva
Mentor
Mentor
Accepted solution

Something like this perhaps.

 

(defun c:demo (/ ent last_ent ss)
  (if (setq ss (ssget "_:L" '((0 . "TEXT"))))
    (progn
      (setq last_ent (entlast))
      (command "txt2mtxt" ss "")
      (setq ent (entlast))
      (if (not (eq ent last_ent))
        (progn
          (setq ent (entget ent))
          (setq ent (append ent '((90 . 3) (63 . 256) (45 . 1.1) (441 . 0))))
          (entmod ent)
        )
      )
    )
  )
  (progn)
)

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 3 of 3

Kent1Cooper
Consultant
Consultant

@claimed4all wrote:

I am currently looking for a way to take DTEXT and convert to MTEXT....

 


(setvar 'rantmode 1)

 

[Just a little pet peeve of mine....  There's no such entity type as DTEXT.  It's just TEXT [see the (ssget) filter in hmsilva's routine].  Way back in the 1980's the Text command had limitations that it no longer has, and Dtext as a command name [but never as an entity type] was introduced for improved operation.  It stands for Dynamic Text, and of course no drawn object is dynamic -- it's only in the process of drawing things that a command can operate dynamically, so dynamic-ness is an aspect of the command, not of the entity that it makes.  Ages ago, the regular Text command was altered to be dynamic, and pretty much identical to what the Dtext command originally did.  Either way, the objects created by both commands have never been DTEXT, but have always been just TEXT.  If you want to avoid any possible confusion on the assumption that to some, the word "Text" might be taken to mean (or include) "Mtext," refer to Text as something like "plain Text" to differentiate.]

 

(setvar 'rantmode 0)

Kent Cooper, AIA
0 Likes