PropertySetElement.GetStructuralAsset Method

PropertySetElementGetStructuralAsset Method

Gets a copy of the StructuralAsset.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public StructuralAsset GetStructuralAsset()
Public Function GetStructuralAsset As StructuralAsset
public:
StructuralAsset^ GetStructuralAsset()
member GetStructuralAsset : unit -> StructuralAsset 

Return Value

StructuralAsset
Example
private void ReadMaterialProps(Document document, Material material)
{
   ElementId strucAssetId = material.StructuralAssetId;
   if (strucAssetId != ElementId.InvalidElementId)
   {
      PropertySetElement pse = document.GetElement(strucAssetId) as PropertySetElement;
      if (pse != null)
      {
         StructuralAsset asset = pse.GetStructuralAsset();

         // Check the material behavior and only read if Isotropic
         if (asset.Behavior == StructuralBehavior.Isotropic)
         {
            // Get the class of material
            StructuralAssetClass assetClass = asset.StructuralAssetClass;

            // Get other material properties
            double poisson = asset.PoissonRatio.X;
            double youngMod = asset.YoungModulus.X;
            double thermCoeff = asset.ThermalExpansionCoefficient.X;
            double unitweight = asset.Density;
            double shearMod = asset.ShearModulus.X;

            if (assetClass == StructuralAssetClass.Metal)
            {
               double dMinStress = asset.MinimumYieldStress;
            }
            else if (assetClass == StructuralAssetClass.Concrete)
            {
               double dConcComp = asset.ConcreteCompression;
            }
         }
      }
   }
}
Private Sub ReadMaterialProps(document As Document, material As Material)
    Dim strucAssetId As ElementId = material.StructuralAssetId
    If strucAssetId <> ElementId.InvalidElementId Then
        Dim pse As PropertySetElement = TryCast(document.GetElement(strucAssetId), PropertySetElement)
        If pse IsNot Nothing Then
            Dim asset As StructuralAsset = pse.GetStructuralAsset()

            ' Check the material behavior and only read if Isotropic
            If asset.Behavior = StructuralBehavior.Isotropic Then
                ' Get the class of material
                Dim assetClass As StructuralAssetClass = asset.StructuralAssetClass

                ' Get other material properties
                Dim poisson As Double = asset.PoissonRatio.X
                Dim youngMod As Double = asset.YoungModulus.X
                Dim thermCoeff As Double = asset.ThermalExpansionCoefficient.X
                Dim unitweight As Double = asset.Density
                Dim shearMod As Double = asset.ShearModulus.X

                If assetClass = StructuralAssetClass.Metal Then
                    Dim dMinStress As Double = asset.MinimumYieldStress
                ElseIf assetClass = StructuralAssetClass.Concrete Then
                    Dim dConcComp As Double = asset.ConcreteCompression
                End If
            End If
        End If
    End If
End Sub

No code example is currently available or this language may not be supported.

No code example is currently available or this language may not be supported.

See Also