Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Preserve MTEXT grid location when changing justification (in object properties)

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
marek
156 Views, 2 Replies

Preserve MTEXT grid location when changing justification (in object properties)

Probably there is some system variable, which is changed in my template.

 

The issue:

 

I have MTEXT object with text, justified to Bottom Center. I want to change it to Bottom Left. If I change it, text is visually on the same position, and location geometry (grid) is changed. The same of command JUSTIFYTEXT.

 

But my intention is to keep grid location and visually move text around the "point".

 

How to do it?

What system variable do I need to change?

 

Thank you.

2 REPLIES 2
Message 2 of 3
marek
in reply to: marek

My workaround:

 

All my MTEXTs are very similar, no annotative, one line, same height, similar width, justification is Bottom Center.

 

So I can change them to DTEXTs and move it to original positions and then changing justification works as I described.

 

1/ I need to remember original position, so for one MTEXT object a create POINT in grid point of that MTEXT object. Let call it pivot point and pivot text.

 

2/ I set same width for all MTEXT objects. Bigger than the biggest one, so no word wrap happen.

 

3/ Set justification to Bottom Left. Now all MTEXT objects have exactly same distance of current grid point to original grid point (distance is width/2).

 

4/ Explode these MTEXT objects to DTEXT objects.

 

5/ Move to original grid points. Move all these DTEXT so pivot text has its grid point in pivot point.

 

6/ Delete temporary pivot point.

Message 3 of 3
ВeekeeCZ
in reply to: marek

I wrote this simple routine for myself to convert MTEXTs (in my case usually coming from C3D) to TEXT preserving the origin.

 

 

(defun c:Mtext2Text ( / ss ed)
  (if (setq ss (ssget '((0 . "MTEXT"))))
    (progn
      (command "_.UCS" "_World")
      (repeat (setq i (sslength ss))
	(setq ed (entget (ssname ss (setq i (1- i)))))
	(entmake (list (cons 0 "TEXT")
		       (assoc 10 ed)
		       (assoc 40 ed)
		       (assoc 1  ed)
		       (assoc 8  ed)
		       (assoc 50 ed)
		       )))
      (command "_.ERASE" ss "")
      (command "_.UCS" "_Previous")
      ))
  (princ)
  )

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost