Skip to main content
Solved

Assigning separate colours to grouped multiline text in AutoCAD

  • March 1, 2023
  • 2 replies
  • 94 views

kdwss
Contributor
Forum|alt.badge.img+3
  • Contributor
  • 3 replies

I can group separate features together for labelling purposes and this is what the attribute looks like as an autocad_mtext_string

 imageHowever, I can only assign one colour by using this approach.

How can I assign separate colours to lines of text within a grouped mtext string so it looks like this?

image.png 

Best answer by caracadrian

Autocad sets color in mtext via \Ccolor_number in strings and font via \fFONT_NAME.

Using this in LabelPointReplacer:

\C3;How now green cow
\C7;How now black cow
\C5;How now blue cow

gives this result:

dwg multi_color_mtextThis string in LabelPointReplacer:

\fISOCPEUR|b0|i0;\C3;How now green cow
\C7;How now black cow
\C5;How now blue cow

gives this result:

dwg multi_color_mtext ISOCPEURI also attached a sample workspace. 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

caracadrian
Contributor
Forum|alt.badge.img+23
  • Contributor
  • 571 replies
  • Best Answer
  • March 2, 2023

Autocad sets color in mtext via \Ccolor_number in strings and font via \fFONT_NAME.

Using this in LabelPointReplacer:

\C3;How now green cow
\C7;How now black cow
\C5;How now blue cow

gives this result:

dwg multi_color_mtextThis string in LabelPointReplacer:

\fISOCPEUR|b0|i0;\C3;How now green cow
\C7;How now black cow
\C5;How now blue cow

gives this result:

dwg multi_color_mtext ISOCPEURI also attached a sample workspace. 


kdwss
Contributor
Forum|alt.badge.img+3
  • Author
  • Contributor
  • 3 replies
  • March 2, 2023

Autocad sets color in mtext via \Ccolor_number in strings and font via \fFONT_NAME.

Using this in LabelPointReplacer:

\C3;How now green cow
\C7;How now black cow
\C5;How now blue cow

gives this result:

dwg multi_color_mtextThis string in LabelPointReplacer:

\fISOCPEUR|b0|i0;\C3;How now green cow
\C7;How now black cow
\C5;How now blue cow

gives this result:

dwg multi_color_mtext ISOCPEURI also attached a sample workspace. 

You've solved my problem. Thank  you!