TheSwamp

Code Red => .NET => Topic started by: ajtruckle on September 23, 2021, 01:55:31 PM

Title: How do we get the _AcDb.ViewPort element for "model space" in AutoCAD?
Post by: ajtruckle on September 23, 2021, 01:55:31 PM
I have also asked the same question https://stackoverflow.com/q/69299086/2287576 (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.