Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
How do I assume a category to a generated material. My code with the current result attached (v2013).
Thanks in advance,
Jon
Document doc = commandData.Application.ActiveUIDocument.Document; Application app = commandData.Application.Application; Transaction trn = new Transaction(doc, "ggTest"); trn.Start(); ElementId id = Autodesk.Revit.DB.Material.Create(doc, "STEEL"); Material material = doc.GetElement(id) as Material; StructuralAsset strucAsset = new StructuralAsset("My Property Set", StructuralAssetClass.Metal); PropertySetElement pse = PropertySetElement.Create(doc, strucAsset); material.SetMaterialAspectByPropertySet(MaterialAspect.Structural, pse.Id); doc.Regenerate(); trn.Commit(); return Result.Succeeded;
Solved! Go to Solution.