Hi All,
I was trying to duplicate floor types with code below. It looks working but for some reason it's not reflected on Revit Type Selector. I tested it with dynamo and the new type is showing there..Something am i missing? Thanks.
{ FloorType floorType = new FilteredElementCollector(doc) .OfClass(typeof(FloorType)) .WhereElementIsElementType() .Cast<FloorType>() .Last(); Element newType = floorType.Duplicate("SAMPLE TYPE"); doc.Regenerate(); }
Solved! Go to Solution.
Solved by recepagah12. Go to Solution.
I tested the same code in Revit 2020 and it worked. Did you write this code in open transaction? Also, you don't need to regenerate the document. Also, don't forget the test if the floor type is null or not. If you have any further question don't hesitate to ask?
I hope this helps,
Recep.
Can't find what you're looking for? Ask the community or share your knowledge.