Hi there!
i’m trying to set different values to some photometric parameters such as “Luminous Flux” or “Initial Intensity” inside family environment (I’m building lighting fixtures families) and I fail every time and i’ve been trying for days. When i get those values, them appear to be “0” and the parameter type of those show as “Invalid”
Can someone put some light into this dark spot where i’m in?
# Phython-Standard- und DesignScript-Bibliotheken laden
import sys
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
def Element(x):
return UnwrapElement(x).get_Parameter(BuiltInParameter.FBX_LIGHT_INITIAL_INTENSITY).AsInteger()
OUT = []
for i in IN[0]:
OUT.append(Element(i))
when i switch to AsString i get “Null” – i don`t know which datatype it is?
# Phython-Standard- und DesignScript-Bibliotheken laden
import sys
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
def Element(x):
return UnwrapElement(x).get_Parameter(BuiltInParameter.FBX_LIGHT_INITIAL_INTENSITY).AsInteger()
OUT = []
for i in IN[0]:
OUT.append(Element(i))
when i switch to AsString i get “Null” – i don`t know which datatype it is?
[/quote]
I believe you have to go through the API to get anything inside those parameters (and any other parameter that includes a flyout for multiple values).
This post has more info and a few examples. You can also search for the top level parameters in the API Docs and see that some of them have properties for the other values.
# Phython-Standard- und DesignScript-Bibliotheken laden
import sys
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
def Element(x):
return UnwrapElement(x).get_Parameter(BuiltInParameter.FBX_LIGHT_LIMUNOUS_FLUX).AsInteger()
OUT = []
for i in IN[0]:
OUT.append(Element(i))
which data typ do i need? AsString and AsInteger does not work
You may have to go through the other classes (selectable parameters) in order to get those values. Even though they’re built-in parameters, they’re properties of the class, not parameters of the element. Look at the API Docs link I posted for an example.
Wow. I’ts a shame that they are not doing anything about that “bug”… anyway, i’m glad to know at least that it’s not possible to do that and i’m no longer stamping onto the wall.