Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CHANGE MTEXT FORMATTING TO JUSTIFIED BY SELECTION

15 REPLIES 15
Reply
Message 1 of 16
bobafuka
1407 Views, 15 Replies

CHANGE MTEXT FORMATTING TO JUSTIFIED BY SELECTION

Can any one help with this??

I'm a bit over trawling the forum.

I am trying to create a lisp routine to enable me to select an/each Mtext entity to change the formatting to justified.

Justifytext does not seem to change the formatting within the mtext editor.

Many thanks in advance.
Regards,

Boba Fuka
Big Booty Bounty Hunter
15 REPLIES 15
Message 2 of 16
Kent1Cooper
in reply to: bobafuka

If you have the Properties box up, you can select as may pieces of Mtext as you want, and just pick in the Justify slot and give them all the same justification together [you don't specify which kind -- all Mtext is already justified, one way or another].

--
Kent Cooper


BOBAFUKA wrote...
....
I am trying to create a lisp routine to enable me to select an/each Mtext entity to change the formatting to justified.
....
Kent Cooper, AIA
Message 3 of 16
bobafuka
in reply to: bobafuka

Kent,
Yeah, I was trying to avoid the properties box for time but this only effecs the TL, TC, TR, Ml, etc not the justified to make both sides line up.
Opening each MT dialog box and selecting all and hitting justify is even longer and matchprop doesn't do it.
Or am I missing something "wood for the tree"s style?
Regards,

Boba Fuka
Big Booty Bounty Hunter
Message 4 of 16
Kent1Cooper
in reply to: bobafuka

[That's not an option that I have back in 2004.]
--
Kent Cooper


bobafuka wrote...
....justified to make both sides line up....
Kent Cooper, AIA
Message 5 of 16
bobafuka
in reply to: bobafuka

Maybe "fit" would be a better word...
But justifytext - fit does nothing.
Regards,

Boba Fuka
Big Booty Bounty Hunter
Message 6 of 16
Anonymous
in reply to: bobafuka

I suspect you need to understand there are two distinct ways mtext
justificaction may be specified. It may be a property of the object, or the
mtext object itself may contain formatting codes which define justification.

Joe Burke


wrote in message news:6384177@discussion.autodesk.com...
Maybe "fit" would be a better word...
But justifytext - fit does nothing.
Message 7 of 16
bobafuka
in reply to: bobafuka

Yes....My bad.
I'm trying to jusify the mtext internal formatting method.
Not as a property.
Regards,

Boba Fuka
Big Booty Bounty Hunter
Message 8 of 16
Anonymous
in reply to: bobafuka

Okay, so let's be clear.

When an mtext object contains embedded justification formatting codes that
overrules the justification property of the mtext object.

As I see it you have two options.

You could use Steve Doman's StripMtext routine to remove the embedded
justification codes. Then Kent's suggestion would work since justification
would be controlled by the object justification property.

The alternative is attempt to modify the embedded justification codes to
suit you needs. While that can be done, it will be complicated from a code
standpoint.

Link to the latest version of StripMtext:
http://www.theswamp.org/index.php?topic=31584.0 at theswamp. You must join
to enable downloading.

Joe Burke


wrote in message news:6385515@discussion.autodesk.com...
Yes....My bad.
I'm trying to jusify the mtext internal formatting method.
Not as a property.
Message 9 of 16
bobafuka
in reply to: bobafuka

Yes Thanks..
I already use the stripmtext functions and have a routine to perform the function.
But...... isn't that going backwards.... while I'm trying to add a format...?!
Regards,

Boba Fuka
Big Booty Bounty Hunter
Message 10 of 16
Anonymous
in reply to: bobafuka

Please post an example file which demonstrates a before and after condition.

Also let us know which version you are using.

Joe Burke

wrote in message news:6386181@discussion.autodesk.com...
Yes Thanks..
I already use the stripmtext functions and have a routine to perform the
function.
But...... isn't that going backwards.... while I'm trying to add a
format...?!
Message 11 of 16
bobafuka
in reply to: bobafuka

Ok.
Here it is.
As you can see, TL just is nice.
TextJustify does nothing.
Formatted Justified makes the text justified to both left and right sides,
We use this in menus , keys, etc in the title box etc.

I'm after just a quick click solution to do this..
Any help is greatly appreciated.
ACAD2009 (and soon 2010 unfortunately)

Edited by: bobafuka on May 9, 2010 9:16 AM Edited by: bobafuka on May 9, 2010 9:19 AM
Regards,

Boba Fuka
Big Booty Bounty Hunter
Message 12 of 16
Anonymous
in reply to: bobafuka

Sorry but your last post is clear as mud.


wrote in message news:6388110@discussion.autodesk.com...
Ok.
Here it is.
As you can see, TL just is nice.
TextJustify does nothing.
Formatted Justified makes the text justified to both left and right sides,
We use this in menus , keys, etc in the title box etc.

I'm after just a quick click solution to do this..
Any help is greatly appreciated.
ACAD2009 (and soon 2010 unfortunately)

Edited by: bobafuka on May 9, 2010 9:16 AM

Edited by: bobafuka on May 9, 2010 9:19 AM
Message 13 of 16
bobafuka
in reply to: bobafuka

I want it to look like the bottom one.
Which must be editted/formatted in the editor not via the properties.
Regards,

Boba Fuka
Big Booty Bounty Hunter
Message 14 of 16
Anonymous
in reply to: bobafuka

Here's an example of how it might be done.

{code}
;; If embedded mtext justification is found, change it to justified.
(defun c:test ( / e obj str pos tempstr newstr)
(vl-load-com)
(if
(and
(setq e (car (entsel "\nSelect mtext object: ")))
(setq obj (vlax-ename->vla-object e))
(eq "AcDbMText" (vlax-get obj 'ObjectName))
(setq str (vlax-get obj 'TextString))
(setq pos (vl-string-search "\\pxq" str))
(setq tempstr (substr str (1+ pos) 5))
(setq newstr (vl-string-subst "\\pxqj" tempstr str pos))
)
(vlax-put obj 'TextString newstr)
)
(princ)
)
{/code}

Joe Burke


wrote in message news:6388639@discussion.autodesk.com...
I want it to look like the bottom one.
Which must be editted/formatted in the editor not via the properties.
Message 15 of 16
bobafuka
in reply to: bobafuka

The text is new and has no emdedded formatting..
...
and i'm no where near that level yet....!!!
Regards,

Boba Fuka
Big Booty Bounty Hunter
Message 16 of 16
CadDog02
in reply to: bobafuka

How can I (we) get more out of this lisp...???

Here is one I fond that changes the font but
I can't figure out what other code to use to change to romans...

*****
[code]

(defun c:FontChange (/ i ss ent eLst)

(if (setq i -1 ss (ssget "_:L" '((0 . "MTEXT"))))
(while (setq ent (ssname ss (setq i (1+ i))))
(entmod
(subst
(cons 1
(strcat "{\\fCopperplate Gothic Bold|b1|i0|c0|p34;"
(cdr (assoc 1 (setq eLst (entget ent)))) "}"))
(assoc 1 eLst)
eLst))))

(princ))

[/code] Edited by: CadDog02 on May 19, 2010 9:48 PM

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

Post to forums  

Autodesk Design & Make Report

”Boost