Identify the associated building structural elements for the propertySetElement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The following code works fine for getting all "PropertySetElements" in a Revit document.
But, I have to identify the associated building structural elements for the propertySetElement. Any suggestions?
//property set: thermal and structural
FilteredElementCollector collector2 = new FilteredElementCollector(doc);
ICollection<Element> propertySet = collector2.OfClass(typeof(PropertySetElement)).ToElements();
//loop through property sets to gather structural and thermal assets
foreach (PropertySetElement psEle in propertySet)
{
try
{
//gather
StructuralAsset structAsset = psEle.GetStructuralAsset();
Type test = psEle.GetType();
string test_1 = psEle.ToString();
//process - currently add both aspects of property set if they exist
//this method can have same p-set element id in both thermal and structural
if (structAsset.Behavior == StructuralBehavior.Isotropic)
{
// Get the class of material
StructuralAssetClass assetClass = structAsset.StructuralAssetClass; // Get other material properties
// Get other material properties
double poisson = structAsset.PoissonRatio.X;
double youngMod = structAsset.YoungModulus.X;
double thermCoeff = structAsset.ThermalExpansionCoefficient.X;
double unitweight = structAsset.Density;
double shearMod = structAsset.ShearModulus.X;
double dampingRatio = structAsset.DampingRatio;
if (assetClass == StructuralAssetClass.Metal)
{
double dMinStress = structAsset.MinimumYieldStress;
}
else if (assetClass == StructuralAssetClass.Concrete)
{
double dConcComp = structAsset.ConcreteCompression;
}
}
}
catch
{
//code
}
try
{
//gather
ThermalAsset thermAsset = psEle.GetThermalAsset();
//process - currently add both aspects of property set if they exist
//this method can have same p-set element id in both thermal and structural
if (thermAsset.ThermalMaterialType == ThermalMaterialType.Solid)
{
// thermalAssets.Add(psEle);
// Get the properties which are supported in solid type
bool isTransmitsLight = thermAsset.TransmitsLight;
double permeability = thermAsset.Permeability;
double porosity = thermAsset.Porosity;
double reflectivity = thermAsset.Reflectivity;
double resistivity = thermAsset.ElectricalResistivity;
StructuralBehavior behavior = thermAsset.Behavior;
// Get the other properties.
double heatOfVaporization = thermAsset.SpecificHeatOfVaporization;
double emissivity = thermAsset.Emissivity;
double conductivity = thermAsset.ThermalConductivity;
double density = thermAsset.Density;
}
}
catch
{
//code
}
}
