I've been reading up on creating Named Views in AutoCAD Help facilities and am wanting to know if specific parameters can be set for this named view.
Paramaters such as VisualStyle, Background (set to solid with white 255 as the base color)
This is from the help files...
Imports Autodesk.AutoCAD.ApplicationServices Imports Autodesk.AutoCAD.DatabaseServices Imports Autodesk.AutoCAD.Runtime <CommandMethod("CreateNamedView")> _ Public Sub CreateNamedView() '' Get the current database Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument Dim acCurDb As Database = acDoc.Database '' Start a transaction Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction() '' Open the View table for read Dim acViewTbl As ViewTable acViewTbl = acTrans.GetObject(acCurDb.ViewTableId, OpenMode.ForRead) '' Check to see if the named view 'View1' exists If (acViewTbl.Has("View1") = False) Then '' Open the View Table for write acViewTbl.UpgradeOpen() '' Create a new View table record and name the view "View1" Dim acViewTblRec As ViewTableRecord = New ViewTableRecord() acViewTblRec.Name = "View1" '' Add the new View table record to the View table and the transaction acViewTbl.Add(acViewTblRec) acTrans.AddNewlyCreatedDBObject(acViewTblRec, True) '' Set 'View1' current acDoc.Editor.SetCurrentView(acViewTblRec) '' Commit the changes acTrans.Commit() End If '' Dispose of the transaction End Using End Sub
Thanks in advance.
Hi,
For the Background, please refer to "CreateBackground" and "RemoveBackground" methods in this blog post :
For setting other view parameters including visual style, the following blog post should be of some help :
http://adndevblog.typepad.com/autocad/2014/02/3dwalk-through-an-autocad-model.html
Regards,
Balaji