Author Topic: How do we get the _AcDb.ViewPort element for "model space" in AutoCAD?  (Read 2009 times)

0 Members and 1 Guest are viewing this topic.


  • Mosquito
  • Posts: 6
I have also asked the same question

I understand that we can get at the modelspace viewport like this:

Code - C#: [Select]
  1. var vpt = acTransNewDb.GetObject(newDb.ViewportTableId, _AcDb.OpenMode.ForRead) as _AcDb.ViewportTable;
  2. var vptr = acTransNewDb.GetObject(vpt["*Active"], _AcDb.OpenMode.ForWrite) as _AcDb.ViewportTableRecord;

Note that my drawing is a new one created in memory and not on screen. All entities added are in the default modelspace location.

The problem is that the ViewportTableRecord element does not include the extra properties like ViewCenter etc. For these properties I need the Viewport element instead. How do I get this?

Thank you.