You may be out of luck. I presume w/ this you can set all but the legacy
[CommandMethod("CreateFloatingViewport")]
public static void CreateFloatingViewport()
{
// Get the current document and database, and start a transaction
Document acDoc = acadApp.DocumentManager.MdiActiveDocument;
Database db = acDoc.Database;
Editor ed = acDoc.Editor;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
// Open the Block table for read
BlockTable acBlkTbl;
acBlkTbl = tr.GetObject(db.BlockTableId,OpenMode.ForRead) as BlockTable;
// Open the Block table record Paper space for write
BlockTableRecord acBlkTblRec;
acBlkTblRec = tr.GetObject(acBlkTbl[BlockTableRecord.PaperSpace], OpenMode.ForWrite) as BlockTableRecord;
// Switch to the previous Paper space layout
acadApp.SetSystemVariable("TILEMODE", 0);
acDoc.Editor.SwitchToPaperSpace();
// Create a Viewport
Viewport acVport = new Viewport();
acVport.SetDatabaseDefaults();
acVport.CenterPoint = new Point3d(3.25, 3, 0);
acVport.Width = 6;
acVport.Height = 5;
DBVisualStyle vs=new DBVisualStyle();
DBDictionary nod = tr.GetObject(db.NamedObjectsDictionaryId, OpenMode.ForRead) as DBDictionary;
DBDictionary dic = tr.GetObject(nod.GetAt("ACAD_VISUALSTYLE"), OpenMode.ForRead) as DBDictionary;
foreach (DBDictionaryEntry entry in dic)
{
ed.WriteMessage(Environment.NewLine + "name=" + entry.Key + " objectid=" + entry.Value.ToString());
}
ObjectId vsId = dic.GetAt("Linepattern");
acVport.SetShadePlot(ShadePlotType.VisualStyle, vsId);
// Add the new object to the block table record and the transaction
acBlkTblRec.AppendEntity(acVport);
tr.AddNewlyCreatedDBObject(acVport, true);
// Enable the viewport
acVport.On = true;
PromptEntityOptions peo = new PromptEntityOptions("Select an entity:");
peo.SetRejectMessage("Must be a vp:");
peo.AddAllowedClass(typeof(Viewport), true);
PromptEntityResult per = ed.GetEntity(peo);
if (per.Status != PromptStatus.OK) return;
Viewport vp = tr.GetObject(per.ObjectId, OpenMode.ForRead) as Viewport;
//Util.Debug.Print(vp.VisualStyleId.ToString());
ed.WriteMessage(Environment.NewLine + vp.ShadePlotId.ToString());
ed.WriteMessage(Environment.NewLine + vp.ShadePlot.ToString());
// Save the new objects to the database
tr.Commit();
}
}
My print out is
Command: CREATEFLOATINGVIEWPORT
name=2dWireframe objectid=(2129252152)
name=Basic objectid=(2129252144)
name=Brighten objectid=(2129252200)
name=ColorChange objectid=(2129252232)
name=Conceptual objectid=(2129252176)
name=Dim objectid=(2129252192)
name=EdgeColorOff objectid=(2129257512)
name=Facepattern objectid=(2129252224)
name=Flat objectid=(2129252112)
name=FlatWithEdges objectid=(2129252120)
name=Gouraud objectid=(2129252128)
name=GouraudWithEdges objectid=(2129252136)
name=Hidden objectid=(2129252168)
name=JitterOff objectid=(2129257496)
name=Linepattern objectid=(2129252216)
name=OverhangOff objectid=(2129257504)
name=Realistic objectid=(2129252184)
name=Shaded objectid=(2129257616)
name=Shaded with edges objectid=(2129257608)
name=Shades of Gray objectid=(2129257584)
name=Sketchy objectid=(2129257592)
name=Thicken objectid=(2129252208)
name=Wireframe objectid=(2129252160)
name=X-Ray objectid=(2129257600)Regenerating layout.
Regenerating model.
Select an entity:
(0)
Hidden
with a null object id for the vp I picked that had been manually configured to legacy hidden (That's the one I use as well)