Author Topic: MText color in transient graphics  (Read 1459 times)

0 Members and 1 Guest are viewing this topic.

sdunn

  • Newt
  • Posts: 90
MText color in transient graphics
« on: March 12, 2012, 02:57:25 PM »
I am trying to create transient mtext with colors altered.  I have tried changing the colorindex property and also imbedding the color property into the contents.  The former doesn't appear to do anything while the latter will not properly imbed the string.

For example:
color = 2, txt = "Low Pt"
The label contents will be "{\\C2;Low Pt}" in a debug windows, but it appears as "\C2;Low Pt" on screen.

Am I missing something?

Code - vb.net: [Select]
  1.        
  2.  
  3.  Private Sub showlabel(ByVal txt As String, ByVal pt As Point3d, ByVal color As Integer)
  4.             Dim label As New MText
  5.             label.Contents = "  {" + Chr(92) + Chr(92) + "C" + color.ToString + ";" + txt + "}"
  6.             'label.Contents = "   " + txt
  7.             label.Location = pt
  8.             label.TextHeight = settings.Size / 2
  9.             label.ColorIndex = color
  10.             m_mrkers.Add(label)
  11.             aGi.TransientManager.CurrentTransientManager.AddTransient(label, aGi.TransientDrawingMode.DirectShortTerm, 128, intColl)
  12.         End Sub
  13.  

Jeff H

  • Needs a day job
  • Posts: 6144
Re: MText color in transient graphics
« Reply #1 on: March 12, 2012, 03:08:56 PM »
if you want "{C2;Low Pt}" to appear then try "\{C2;Low Pt\}" or am I missing something?
 
 
 

sdunn

  • Newt
  • Posts: 90
Re: MText color in transient graphics
« Reply #2 on: March 12, 2012, 03:29:10 PM »
I want "Low Pt" to appear as color yellow in the transient graphic.

Jeff_M

  • King Gator
  • Posts: 4087
  • C3D user & customizer
Re: MText color in transient graphics
« Reply #3 on: March 12, 2012, 06:41:04 PM »
I ran into this about a year ago and submitted a support request with Autodesk. This was a portion of their response:
Quote
Sorry, This is a known behavior for which we already have a change request logged. The change request number is 1384259.

When the visual style is not “2d wireframe”, only then the text that is part of the transient graphics changes its color based on the value that is set.

sdunn

  • Newt
  • Posts: 90
Re: MText color in transient graphics
« Reply #4 on: March 13, 2012, 09:57:24 AM »
that sucks.

thanks for the info Jeff.