View3D view3d;
using (Transaction ts = new Transaction(doc, "3dview"))
{
ts.Start();
ViewFamilyType viewtype = new FilteredElementCollector(doc).OfClass(typeof(ViewFamilyType))
.Cast<ViewFamilyType>()
.FirstOrDefault<ViewFamilyType>(
x => ViewFamily.ThreeDimensional
== x.ViewFamily);
view3d = View3D.CreateIsometric(doc, viewtype.Id);
ts.Commit();
uidoc.ActiveView = view3d;
}