Message 1 of 2

Not applicable
04-10-2019
09:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I am filtering all the materials and I want to sort them by the Type property that belongs to the Physical Asset. Up to now, I have tried the following:
ElementId materialId = keyMaterialId; Element e = m_doc.GetElement(materialId); Parameter paramMaterial = e.get_Parameter(BuiltInParameter.STRUCTURAL_MATERIAL_PARAM); Material material = m_doc.GetElement(materialId) as Material; if (material.StructuralAssetId != ElementId.InvalidElementId) { PropertySetElement property = m_doc.GetElement(material.StructuralAssetId) as PropertySetElement; Parameter paramType = property.get_Parameter(BuiltInParameter.PHY_MATERIAL_PARAM_TYPE); if (paramType != null) Debug.WriteLine("material " + paramType.AsValueString()); }
The code gets into the first if, so that means that it correctly gets the Physical Asset, but when I try to get the Type (in the variable paramType), paramType is always null, I know this because it never does the Debug.Writeline();
Any ideas?
Regards,
JMGP
Solved! Go to Solution.