Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66692

drafting view

$
0
0

 

Hi everyone,

 

I create a drafting view in Revit using the following code (from here)

 

ViewFamilyType vd = new FilteredElementCollector(doc)
.OfClass(typeof(ViewFamilyType))
.Cast<ViewFamilyType>()
.FirstOrDefault(q => q.ViewFamily == ViewFamily.Drafting);
ViewDrafting draftView = ViewDrafting.Create(doc, vd.Id);

which is working fine, UNLESS I am working with the defaultFRAFRA.rte  project template. In that case, vd is null and I obviously get a  NullReferenceExcception when Calling ViewDrafting.Create.

 

A quick debug session shows me that when I use FR-FR templates, the filtered element collector does not return any Drafting view family types.v (see http://screencast.com/t/TG9J48Wp6Wq )

 

Did anyone already have this problem? if so, do you have any work around to suggest?

 

Thanks!

 

 


Viewing all articles
Browse latest Browse all 66692

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>