Turn on Text Frame for metxt

Turn on Text Frame for metxt

mschirmer
Advocate Advocate
2,488 Views
6 Replies
Message 1 of 7

Turn on Text Frame for metxt

mschirmer
Advocate
Advocate

Is there a lisp code name for turning on text frame?  I can write it up to place a Pline around mtext or text, but I would like to use the MTExt text frame, if possible.

0 Likes
Accepted solutions (2)
2,489 Views
6 Replies
Replies (6)
Message 2 of 7

Ranjit_Singh
Advisor
Advisor
Accepted solution

I am on 2015 so I cannot verify the below code, but try it out

 

(defun c:somefunc  (/ ss1 ent)
 (setq ss1 (ssget '((0 . "MTEXT"))))
 (mapcar '(lambda (x)
           (if (= (type (setq ent (cadr x))) 'ename)
            (progn (entmod (append (entget ent) '((90. 16) (63 . 256) (45 . 1.5) (441 . 0))))
            (entupd ent))))
         (ssnamex ss1))
 (princ))

 

If it works, play with the values in the dotted pairs to see if you get desired result.

Message 3 of 7

mschirmer
Advocate
Advocate

Ranjit,

 

Thanks for the assistance.  I'm on 2016. . I received an error stating "bad DXF group: (90.0 16)".  I did an entsel and entget and the dxf info i retrieved was the following.  I'm not sure what i should be looking for.

 

((-1 . <Entity name: 7ffffb28330>) (0 . "MTEXT") (330 . <Entity name: 7ffff9e6980>) (5 . "3AE3") 
(100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "ENTOS-LSB") (100 . "AcDbMText") (10 1762.97 370.95 0.0)
(40 . 24.0) (41 . 559.946) (46 . 155.752) (71 . 2) (72 . 5)
(1 . "Daisy Brand\\PSuite 600\\P26,279 RSF\\PEXP: 01-31-2017") (7 . "ARIAL")
(210 0.0 0.0 1.0) (11 1.0 0.0 0.0) (42 . 253.048) (43 . 145.342) (50 . 0.0) (73 . 1) (44 . 1.0))

 

0 Likes
Message 4 of 7

steve_carson
Enthusiast
Enthusiast
Accepted solution

Try adding a space between the 90 and the dot. It's trying to make your 90 key into 90.0.

Message 5 of 7

mschirmer
Advocate
Advocate

Thanks Steve.  That did the trick!

0 Likes
Message 6 of 7

mschirmer
Advocate
Advocate

Ranjit,

 

Thanks so much.  That did work after all.  I haven't understood the Lambda and mapcar so i definitely appreciate this.  It will take me some time to go back over this and figure out what you did due to our busy schedule here.  But again, thanks!

0 Likes
Message 7 of 7

Ranjit_Singh
Advisor
Advisor

Glad it worked for you. There are lots of discussion online on mapcar. Here's my 2 cents. Let me know if you still have a hard time figuring it out.

0 Likes