What is the correct way of copying an existing viewport, What I am actually doing is that to clone a layout by copying what is inside it, everything works smoothly except for the viewports. I tried to use the clone method, but it didn't work, I also tried to use the copyfrom method but also to no avail. In both cases the copied viewport is a dumb black rectangle
Dim exkeyvport As Autodesk.AutoCAD.DatabaseServices.Viewport = DirectCast(acTrans.GetObject(objId, OpenMode.ForRead), Autodesk.AutoCAD.DatabaseServices.Viewport)
Dim keyvport As New Autodesk.AutoCAD.DatabaseServices.Viewport
keyvport.CopyFrom(exkeyvport)
keyvport.UpdateDisplay()
NewblkTableRec.AppendEntity(keyvport)
acTrans.AddNewlyCreatedDBObject(keyvport, True)
The only way that partially worked for me was to create a viewport and copy its attributes one by one, but this is exhaustive and not reliable, so could anyone tell us of the proper way to copy a viewport?