Get color temperature value

Get color temperature value

charles200221
Contributor Contributor
462 Views
1 Reply
Message 1 of 2

Get color temperature value

charles200221
Contributor
Contributor

Hello everyone.

I'm referencing this to store all the value I want and send them to sql server.  But I can't get color temperature inside inital color.

Then I'm referencing this to get color temperature individually. But I don't know how to get element id for Element e since I open rfa file from the start.

Here is my code.

            UIApplication app = commandData.Application;
            UIDocument uidoc = app.ActiveUIDocument;
            Document doc = uidoc.Document;
            FamilyManager mgr = doc.FamilyManager;
            Element e = doc.GetElement();
            ElementType ET = doc.GetElement(e.GetTypeId()) as ElementType;
            Parameter initailColor = ET.get_Parameter(BuiltInParameter.FBX_LIGHT_INITIAL_COLOR_TEMPERATURE);
            string colorTemperature = initailColor.AsValueString();

 Hope someone can help.

0 Likes
Accepted solutions (1)
463 Views
1 Reply
Reply (1)
Message 2 of 2

charles200221
Contributor
Contributor
Accepted solution

Hello everyone. Sorry for bothering everybody.

I just found the workaround with getting the value of color temperature. 

It's one of the reply in the same post listed before.

Here's the code.

 

            LightFamily LF = LightFamily.GetLightFamily(doc);
            LightType lighttyp = LF.GetLightType(0);

            if (lighttyp != null)
            {
                InitialColor iniColor = lighttyp.GetInitialColor();
                double colorTemperature = iniColor.TemperatureValue;
            }

 

0 Likes