Reputation: 135
I am working on a task where I need to accept a template file (.rte) as input and save the resultant revit file in 3d view.
I understand that to activate 3d view, we need UIDocument
which is not available when we work in DesignAutomation API.
In an addin project in the past I had implemented it in the following way:
FilteredElementCollector collector = new FilteredElementCollector(doc).OfClass(typeof(View3D));
foreach (View3D v in collector)
{
if (!v.IsTemplate)
{
uiApp.ActiveUIDocument.ActiveView = v;
}
}
So is there any other way to do this in DesignAutomation API.
Upvotes: 2
Views: 564
Reputation: 8294
You definitely have no access whatsoever to the UIDocument
in the Design Automation API. It does not even exist. I suggest you just go ahead and generate your Revit model as before and then see what view ends up being saved. Quite possibly it is the 3D view anyway.
Upvotes: 1