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

TEXT and DDEDIT with offset

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
r.stiles
359 Views, 3 Replies

TEXT and DDEDIT with offset

What is the correct way to utilize the ddchprop command with variables in LISP? I receive dxf files with text left justified at the insertion point, I want to center justify the text at the insertion point. I see numerous threads about changing the justification without movement (JUSTIFYTEXT), I want the movement. I would like to use a LISP routine so that when the initial dxf is created (3rd party software) the text can be formatted correctly before opening it in AutoCAD.

3 REPLIES 3
Message 2 of 4
Alfred.NESWADBA
in reply to: r.stiles

Hi,

 

>> [...] I want the movement

Then select the text objects (e.g. using _QSELECT) and change the property "Justify" in the property window.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 4
r.stiles
in reply to: Alfred.NESWADBA

Thank you Alfred, but I believe I was unclear about my requirements. If I use _QSELECT in the routine, I get the dialog box, requiring a user to select the text. I want to run the routine without the user interface. The DXF in question has text on only one layer. Is there a way to invoke _QSELECT and pass variables to it? Initially the DXF contains mtext, I use the following to explode all mtext to single line text:

  (setq :SSET (ssget "X" '((0 . "MTEXT"))))
  (command "explode" :SSET "")

 

Now I want to set the justification to middle center, moving the text to the initial insertion point. I'm working on the following but have not yet tested it (from CAD Forums):

(defun c:rcm (/ e p11 p10 horn vertn vert hor en y)
(setq e (ssget "X" '((0 . "TEXT"))))
p11 (assoc 11 e)
p10 (assoc 10 e)
hor (assoc 72 e)
vert (assoc 73 e)
en e
)
(if (= (cdr hor) 0)
(setq p11n (cons 11 (cdr p10)))
)
(if (= (cdr hor) 0)
(setq en (subst p11n p11 en))
)
(setq horn 1
horn (cons 72 horn)
en (subst horn hor en)
)
(setq vertn 2
vertn (cons 73 vertn)
en (subst vertn vert en)
)
(entmod en)
(setq y "y")
(if (= (strcase y) "N")
(entmod e)
)
(c:rcm)
)

Message 4 of 4
Alfred.NESWADBA
in reply to: r.stiles

Hi,

 

>> Is there a way to invoke _QSELECT and pass variables to it?

If you don't want QSELECT, then you already have found the LISP function SSGET ... there you can select all text objects.

 

I meant to use QSELECT as I would have used it to re-justify all text objects in a drawing just one command without the need for any development (well in model space and paperspaces seperately).

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)

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

Post to forums  

Autodesk Design & Make Report

”Boost