Jump to content

Recommended Posts

Posted

Hi All,

I need Help again,

My drawing file have lots of text and Mtext with different properties, all Text and mtext are in different color, different angle and different text height.

I need to the script for select red color text and mtext file and change to BOLD, then select all text and mtext change the rotation angle to "0" degree and change the text height as 2mm.

Is it possible to do through lisp.

 

Please anyone help me.

 

Thanks in Advance.

Posted (edited)

This has been discussed before how to find mtext patterns in a string and change them. Look at my other post today re mtext remove. I posted a solution here and so did Lee-mac but its like 12 months ago. I will try to find.

 

The rotation is a property of mtext use (vla-put-rotation strent 0.0)

 

look at this as a start just copy and paste each line to command line, you can see the properties of the mtext.

; pick mtext
(setq strent (vlax-ename->vla-object (car (entsel))))
(alert (vla-get-textstring strent)))

 

Found this not the exact one I wanted but, http://www.cadtutor.net/forum/showthread.php?90577-HELP-LISP-to-change-color-of-text-base-on-certain-words-including-within-nested-block&highlight=Mtext

Edited by BIGAL
Posted

Hi, Bigal,

Thanks for your effort, actually i'm newbie for programme, really i don't know how to use this codes to lisp.

could you please help me.:(

 

Thanks again :(

Posted

Another link http://www.cadtutor.net/forum/showthread.php?92585-HELP-Change-only-the-colour-of-numbers-in-an-mtext&highlight=mtext

 

Again look at the other post it has all the clues just look for "c1" and \\p

 

this is what 3 line of mtext looks like with the second line all red

line1

line2

line3

TextString = "{\\fArial|b0|i0|c0|p34;line1\\P\\C1;line2\\C256;\\Pline3}"

 

The same with second line now bold

line1

line2

line3

TextString = "{\\fArial|b0|i0|c0|p34;line1\\P\\fArial|b1|i0|c0|p34;line2\\fArial|b0|i0|c0|p34;\\Pline3}"

 

Its a case of looking for the string combo the b0 means non bold the b1 means start bold followed by a b0 to end. The c0 is color by layer c1 is color red

Posted

Hi BIGAL,

Thanks for your kind reply,

Now i understood, this will useful for me,

Many thanks:)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...