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

0 Members and 1 Guest are viewing this topic.

ajtruckle

  • Mosquito
  • Posts: 6
I have also asked the same question https://stackoverflow.com/q/69299086/2287576.

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.