- Interior
- Exterior
- Foundation
- Retaining
- Soffit
- Core-Shaft
At first I thought it would be fairly straight-forward, and I'd just do this grab the valuestring of the 'FUNCTION_PARAM' like so:
eWall.get_Parameter("Function").AsValueString()But that gave me a NULL value and crashed Revit. The approach that worked for me was this:
static public string IsExterior(Element e, Document doc)
{
ElementId id = e.GetTypeId();
ElementType wallType = doc.get_Element(id) as ElementType;
Parameter wallFunction = wallType.get_Parameter
(BuiltInParameter.FUNCTION_PARAM);
WallFunction value = (WallFunction)wallFunction.AsInteger();
return value.ToString();
}
Thanks to Jeremy Tammik's SDK example for setting me straight.
No comments:
Post a Comment