I am sudying the sample code in the 'AutoCAD .NET Developer's Guide'.
'CVPORT' is a system variable. It is called as follows:
Application.GetSystemVariable("CVPORT")
'TileMode' is another system variable which is called as follows:
Application.DocumentManager.MdiActiveDocument.Database.TileMode
Can somebody explain me the difference between the two methods of accessing the system variable?
Also, the logic about which method can be used with which system variable because I found that
Application.DocumentManager.MdiActiveDocument.Database.Cvport
does not seem to work.
Hi,
the diffrent between tilemode and cvport is, that the cvport is an object and tilemode only an integer value.
use this:
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
CurrentViewportTableRecordId cvId = db.CurrentViewportTableRecordId;
Transaction tr = db.TransactionManager.StartTransaction();
using (tr)
{
//The following code gets the current viewport as an object.
ViewportTableRecord cv = (ViewportTableRecord)tr.GetObject(cvId, OpenMode.ForRead);
}
I think thats works, but it is not tested.
Jürgen