
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi Folks,
In a custom plugin, I have to create a new Drafting View, and I do the following :
var vft = new FilteredElementCollector(doc).OfClass(typeof(ViewFamilyType)).Cast<ViewFamilyType>().FirstOrDefault(t => t.ViewFamily == ViewFamily.Drafting);
var draft = ViewDrafting.Create(doc, vft.Id);
This worked like a charm, until I found a customer's project that didn't contained any ViewFamilyType of type Drafting.
It seams to be a fatal issue, because :
- Second argument is mandatory (i.e cannot be NULL nor ElementId.Invalid) in ViewDrafting.Create(doc, id)
- There is no API call to create a ViewFamilyType from scratch (Duplicate is not suitable because there is no element to duplicate ...)
Am I toasted ?
Thanks for help 🙂
Solved! Go to Solution.