Message 1 of 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi folks, as shown in picture, I can not duplicate a floorplan view with the code posted below:
//get unitfloor plan
ViewPlan unitFloorPlan = new FilteredElementCollector(doc).OfClass(typeof(ViewPlan))
.Cast<ViewPlan>().FirstOrDefault(x=>x.Name.ToLower().Contains("unit floor plan"));
//1) duplicate the unitFloorPlan
ElementId duplicateUnFP = unitFloorPlan.Duplicate(ViewDuplicateOption.AsDependent);
ViewPlan dupFloorPlan = doc.GetElement(duplicateUnFP) as ViewPlan;
//2) REMOVE THE TEMPLATE VIEW
dupFloorPlan.ViewTemplateId = ElementId.InvalidElementId;
This block of code have been working 100% for all the projects but somehow this is the first time I'm facing this issue: (It doesnt work with all three options: asDependent, etc..)
Any Idea about the subject?
Best regards,
Miguel G.
Solved! Go to Solution.