MOdify Structural Asset

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am getting a very not explanatory error : An internal error has occurred.(Screenshot attached), and would like to know what the error is or how to solve it. Thank you in advance.
Here is working version of my code :
ElementId matID = Material.Create(Data.uiDoc.Document, "Metal - Steel 43-275");
rMat = Data.uiDoc.Document.GetElement(matID) as Material;
StructuralAsset asset = new StructuralAsset("STEEL 43-275", StructuralAssetClass.Metal);
asset.SubClass = "Steel";
rMat.MaterialClass = "Metal";
asset.Name = "STEEL 43-275";
asset.Behavior = StructuralBehavior.Isotropic;
asset.Density = 77.0365930404257 / 0.346436881;
asset.SetYoungModulus(UnitUtils.ConvertToInternalUnits(205000000, DisplayUnitType.DUT_KILONEWTONS_PER_SQUARE_METER));
asset.SetShearModulus(UnitUtils.ConvertToInternalUnits(205000000 / (2 * (1 + 0.3)), DisplayUnitType.DUT_KILONEWTONS_PER_SQUARE_METER));
asset.SetPoissonRatio(0.3);
asset.SetThermalExpansionCoefficient(1.2E-05);
PropertySetElement pse = Data.uiDoc.Document.GetElement(pse.Id) as PropertySetElement;
pse.SetStructuralAsset(asset);
rMat.StructuralAssetId = pse.Id;
Kind regards,