Get AssemblyDetailViewOrientation from existing view

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I was curious if it's possible to access the AssemblyDetailViewOrientation property within a view that exists in the project?
when creating a view via AssemblyViewUtils theres a method:
AssemblyViewUtils.CreateDetailSection(doc, i.Id, AssemblyDetailViewOrientation.ElevationFront)
In this method AssemblyDetailViewOrientation is set to a view type, but I have not managed to find a way to pull this data. Revit of course automatically names the view based on it's orientation, but if a user changes the name of the view, how could you determine the orientation of the view?
I'm trying to pull this data from an existing view to basically create new views for a new assembly that 'duplicate' an existing sheet with views placed on it. But if I can't pull this data from each view then I'll likely have to rely on the view name and account for duplicates which would make it more difficult to accommodate every scenario.
At the moment I am using:
if viewTemplate.Name == "Elevation Front":
view = AssemblyViewUtils.CreateDetailSection(doc, i.Id, AssemblyDetailViewOrientation.ElevationFront)
elif viewTemplate.Name == "Elevation Top":
view = AssemblyViewUtils.CreateDetailSection(doc, i.Id, AssemblyDetailViewOrientation.ElevationTop)
elif viewTemplate.Name == "Plan Detail":
view = AssemblyViewUtils.CreateDetailSection(doc, i.Id, AssemblyDetailViewOrientation.HorizontalDetail)
elif viewTemplate.Name == "Detail Section A":
view = AssemblyViewUtils.CreateDetailSection(doc, i.Id, AssemblyDetailViewOrientation.DetailSectionB)
elif viewTemplate.Name == "3D Ortho":
view = AssemblyViewUtils.Create3DOrthographic(doc, i.Id)
But ultimately I'd like to use:
assemblyViewOrient = templateView.MethodForGetting(AssemblyDetailViewOrientation)
view = AssemblyViewUtils.CreateDetailSection(doc, assembly.Id, AssemblyViewOrient)
where templateView is the pre-existing view
Thanks!