3dwannab Posted April 7, 2018 Posted April 7, 2018 I'm having a fuzzy MTEXT problem found here. It turns out MTEXT has a normal value. This is the cause of the problem, FLATTEN doesn't work, nor changing the Z value of the text. I thought there might be a way with LISP. Cheers. Quote
steven-g Posted April 7, 2018 Posted April 7, 2018 If something has a normal (other than 0) then it was created on another UCS, use the UCS command and the option 'object' select the text and then copy it with base point. reset the UCS to world and paste the mtext now back to the world UCS Quote
3dwannab Posted April 7, 2018 Author Posted April 7, 2018 If something has a normal (other than 0) then it was created on another UCS, use the UCS command and the option 'object' select the text and then copy it with base point. reset the UCS to world and paste the mtext now back to the world UCS That worked but I'm stumped on how to do this on objects with different UCS vals. A LISP would be more beneficial here. Thanks. Here's the entget info for that MTEXT. Nowhere does it list the NORMAL. ((-1 . <Entity name: 21e6398f230>) (0 . "MTEXT") (5 . "383") (102 . "{ACAD_XDICTIONARY") (360 . <Entity name: 21e6398f240>) (102 . "}") (330 . <Entity name: 21e08fde020>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "Defpoints") (100 . "AcDbMText") (10 -178.686 5455.27 -1.24456e-05) (40 . 600.0) (41 . 12000.0) (46 . 0.0) (71 . 2) (72 . 5) (1 . "REAR ELEVATION KINGS ROAD (FuZzy TeXt, Z value is at 0, I need to explode it for it to work and put Z val as 0)") (7 . "Standard") (210 -9.71234e-13 -7.41855e-09 1.0) (11 1.0 1.99153e-16 9.71234e-13) (42 . 11680. (43 . 3818.14) (50 . 1.99153e-16) (73 . 1) (44 . 1.0)) Quote
Grrr Posted April 7, 2018 Posted April 7, 2018 Flanders, group code 210 stands for normal. Also if you dump it you would see the 'Normal property. Quote
rlx Posted April 7, 2018 Posted April 7, 2018 based on the helpfile (zero expercience with normal) (defun c:normal ( / mtext-object mtext-normal newNormal) (if (setq mtext-object (vlax-ename->vla-object (car (entsel)))) (progn (setq mtext-normal (vlax-variant-value (vla-get-Normal mtext-object))) (alert (strcat "Normal mtext object is " (rtos (vlax-safearray-get-element mtext-normal 0) 2) ", " (rtos (vlax-safearray-get-element mtext-normal 1) 2) ", " (rtos (vlax-safearray-get-element mtext-normal 2) 2))) (setq newNormal (vlax-3d-point 0 0 1)) (vla-put-Normal mtext-object newNormal) (vla-Update mtext-object) (setq mtext-normal (vlax-variant-value (vla-get-Normal mtext-object))) (alert (strcat "Normal mtext object is " (rtos (vlax-safearray-get-element mtext-normal 0) 2) ", " (rtos (vlax-safearray-get-element mtext-normal 1) 2) ", " (rtos (vlax-safearray-get-element mtext-normal 2) 2))) ) ) ) gr.Rlx Quote
3dwannab Posted April 7, 2018 Author Posted April 7, 2018 I see that now. (210 -9.71234e-13 -7.41855e-09 1.0) was throwing me off. I was expecting its true value. 0.0000000001 Quote
3dwannab Posted April 7, 2018 Author Posted April 7, 2018 based on the helpfile (zero expercience with normal) Enough for you to get it to work. Thanks very much. Here's the dwg file for testing: Fuzzy Text Problem.dwg Now to see if I can get this to work with multiple selections. A lil' extra step was needed in the code. (defun c:normal ( / mtext-object mtext-normal newNormal) (if (setq mtext-object (vlax-ename->vla-object (car (entsel)))) (progn (setq mtext-normal (vlax-variant-value (vla-get-Normal mtext-object))) (alert (strcat "Normal mtext object is " (rtos (vlax-safearray-get-element mtext-normal 0) 2) ", " (rtos (vlax-safearray-get-element mtext-normal 1) 2) ", " (rtos (vlax-safearray-get-element mtext-normal 2) 2))) (setq newNormal (vlax-3d-point 0 0 1)) (vla-put-Normal mtext-object newNormal) (vla-Update mtext-object) (setq mtext-normal (vlax-variant-value (vla-get-Normal mtext-object))) (alert (strcat "Normal mtext object is " (rtos (vlax-safearray-get-element mtext-normal 0) 2) ", " (rtos (vlax-safearray-get-element mtext-normal 1) 2) ", " (rtos (vlax-safearray-get-element mtext-normal 2) 2))) ; EXTRA STEP: To move the object up then down. (command "_.UCS" "") (command "_.move" (vlax-vla-object->ename mtext-object) "" '(0 0 1e99) "" "_.move" "_p" "" '(0 0 -1e99) "") ) ) ) Quote
maratovich Posted April 7, 2018 Posted April 7, 2018 Run on the command line ((lambda (edata) (entmod (subst (cons 210 '(0 0 1)) (assoc 210 edata) edata))) (entget (car (entsel)))) Quote
3dwannab Posted April 7, 2018 Author Posted April 7, 2018 Run on the command line ((lambda (edata) (entmod (subst (cons 210 '(0 0 1)) (assoc 210 edata) edata))) (entget (car (entsel)))) Nice, that does it all in one go. I'm going to use this and try see if I can filter the selection for non 0 0 1 vals for the normal and do it for more than just one object. Thanks very much. Quote
hanhphuc Posted April 7, 2018 Posted April 7, 2018 based on the helpfile (zero expercience with normal) (setq mtext-normal (vlax-variant-value (vla-get-Normal mtext-object))) gr.Rlx FWIW (setq mtext-normal (vlax-get mtext-object 'Normal ) ) returns listp so no need vlax-variant-value conversion, save long typing Quote
rlx Posted April 7, 2018 Posted April 7, 2018 FWIW (setq mtext-normal (vlax-get mtext-object 'Normal ) ) returns listp so no need vlax-variant-value conversion, save long typing I like short(er) lines . thanx! (one of the little terro's fell asleep in my arms so couldn't respond right away... but her mommy arrived , finally ...) Have a nice weekend gr. Rlx Quote
3dwannab Posted July 4 Author Posted July 4 This has raised it's ugly head again, this time with Mleaders. The normal seems to be fine. See attached and the screenshot below is of Mtext (top entity) and the Mleader (btm one) normal issue mleader.dwg Quote
3dwannab Posted August 30 Author Posted August 30 On 7/4/2024 at 4:21 PM, 3dwannab said: This has raised it's ugly head again, this time with Mleaders. The normal seems to be fine. I created a new thread as it was somewhat different from this thread for MTEXT. In case anyone wants to fix MULTILEADERS, you can go here: Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.