Here is a sample code snippet to set the current view to "Right" view.
On similar lines, the view can be set to any other orthographic view.
[CommandMethod("SetRightView")]
public void SetRightViewMethod()
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
Database db = Application.DocumentManager.MdiActiveDocument.Database;
ed.UpdateTiledViewportsInDatabase();
using (Transaction tr = db.TransactionManager.StartTransaction())
{
ViewportTable vpTbl
= tr.GetObject
(
db.ViewportTableId,
OpenMode.ForRead
) as ViewportTable;
ViewportTableRecord viewportTableRec
= tr.GetObject
(
vpTbl["*Active"],
OpenMode.ForWrite
) as ViewportTableRecord;
viewportTableRec.SetViewDirection
(
OrthographicView.RightView
);
tr.Commit();
}
ed.UpdateTiledViewportsFromDatabase();
}