PropertySetElementGetStructuralAsset Method |
Gets a copy of the StructuralAsset.
Namespace: Autodesk.Revit.DBAssembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntaxpublic StructuralAsset GetStructuralAsset()
Public Function GetStructuralAsset As StructuralAsset
public:
StructuralAsset^ GetStructuralAsset()
member GetStructuralAsset : unit -> StructuralAsset
Return Value
StructuralAsset
Exampleprivate 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();
if (asset.Behavior == StructuralBehavior.Isotropic)
{
StructuralAssetClass assetClass = asset.StructuralAssetClass;
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()
If asset.Behavior = StructuralBehavior.Isotropic Then
Dim assetClass As StructuralAssetClass = asset.StructuralAssetClass
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