.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

System Variables

1 REPLY 1
Reply
Message 1 of 2
sanganaksakha
676 Views, 1 Reply

System Variables

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.

1 REPLY 1
Message 2 of 2

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

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost