TheSwamp

Code Red => .NET => Topic started by: sdunn on March 12, 2012, 02:57:25 PM

Title: MText color in transient graphics
Post by: sdunn 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.  
Title: Re: MText color in transient graphics
Post by: Jeff H 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?
 
 
 
Title: Re: MText color in transient graphics
Post by: sdunn on March 12, 2012, 03:29:10 PM
I want "Low Pt" to appear as color yellow in the transient graphic.
Title: Re: MText color in transient graphics
Post by: Jeff_M 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.
Title: Re: MText color in transient graphics
Post by: sdunn on March 13, 2012, 09:57:24 AM
that sucks.

thanks for the info Jeff.