Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Pad on September 11, 2019, 12:23:40 PM
Title: Change text justification with moving text
Post by: Pad on September 11, 2019, 12:23:40 PM
Hello,
I have some text justified to the right, I wish to change the justification of the text to the left. I want the text to move, ie. not retain its position, as if you had changed the text justification using the properties dialogue box.
I have tried changing dxf codes to (72 . 0) (73 . 1) but the text retains it's position, the same if you use tjust.
Cad file atatched, which should explain what I'm trying to do.
Title: Re: Change text justification with moving text
Post by: ribarm on September 11, 2019, 12:47:55 PM
This will never happen :
(if (= enttyp "MTEXT") (progn (Command "Explode" ss1) (alert "Text was MTEXT! Rerun the command. ") ) )
Because of this selection set filter :
(setq ss1 (ssget "X" '((0 . "TEXT") (8 . "Comments"))))
And beside all this, command EXPLODE won't work on selection sets through routine unless you temporarily set undocumented sys var QAFLAGS = 1...
After all you said that you want to achieve setting text properties like through properties pallete, so why not use pallete if its working well... Tell us why do you need ALISP version of this, what do you want to achieve and you need routine for this...
Title: Re: Change text justification with moving text
Post by: didier on September 11, 2019, 12:54:18 PM
erreur de ma part...
Title: Re: Change text justification with moving text
Post by: Pad on September 11, 2019, 12:56:55 PM
Hi Ribarm,
Thanks for your reply. That it all uncessary code form a lisp I'm bolting on, so don't worry about that.
After all you said that you want to achieve setting text properties like through properties pallete, so why not use pallete if its working well... Tell us why do you need ALISP version of this, what do you want to achieve and you need routine for this... Because it's one step of a few steps I want to have automated in Lisp.
The atached DWG shows what i'm trying to acheive, everything is fine except changing the text justification and having the text move accordingly.
Regards Patrick
Title: Re: Change text justification with moving text
Post by: ribarm on September 11, 2019, 01:29:35 PM
This works on my side (changing text position with justification point) :
Title: Re: Change text justification with moving text
Post by: Pad on September 11, 2019, 02:18:06 PM
Wow thats amazing, a thing of beauty. Works perfectly, thanks Lee. These texts are short annotations done in the field, I then use your BFIND lisp on the text.
Thank you very much!
P
Title: Re: Change text justification with moving text
Post by: Lee Mac on September 11, 2019, 04:26:50 PM