Message 1 of 10
How to change text color ?

Not applicable
10-05-2009
03:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I am using the ColorDialog control from VisualStudio 2008 in order to
select a color and then I retrieve the RGB components in three variables:
ColorComponentRed
ColorComponentGreen
ColorComponentBlue
What I want is to assign this color to some text (it is text because it's
filtered as this) but the following code is not working:
[code]
Dim colorparam As Parameter
colorparam =
elem.ObjectType.Parameter(parameterId:=Parameters.BuiltInParameter.TEXT_COLOR)
Dim app As New Autodesk.Revit.Creation.Application()
Dim color As Autodesk.Revit.Color = app.NewColor()
color.Red = ColorComponentRed
color.Green = ColorComponentGreen
color.Blue = ColorComponentBlue
colorparam.Set(color)
[/code]
Can anybody tell me what I am doing wrong and how to do it, please ?
TIA
--
Humans are born with a wide horizon.
As time goes by, the horizon narrows and
narrows, until it becomes a point of view.
I am using the ColorDialog control from VisualStudio 2008 in order to
select a color and then I retrieve the RGB components in three variables:
ColorComponentRed
ColorComponentGreen
ColorComponentBlue
What I want is to assign this color to some text (it is text because it's
filtered as this) but the following code is not working:
[code]
Dim colorparam As Parameter
colorparam =
elem.ObjectType.Parameter(parameterId:=Parameters.BuiltInParameter.TEXT_COLOR)
Dim app As New Autodesk.Revit.Creation.Application()
Dim color As Autodesk.Revit.Color = app.NewColor()
color.Red = ColorComponentRed
color.Green = ColorComponentGreen
color.Blue = ColorComponentBlue
colorparam.Set(color)
[/code]
Can anybody tell me what I am doing wrong and how to do it, please ?
TIA
--
Humans are born with a wide horizon.
As time goes by, the horizon narrows and
narrows, until it becomes a point of view.