Using
"GEOGRAPHICLOCATION" command you could bring up the "Geographic
Location" window and there you will find the "Up direction"
drop-down to set the "Z" value. If you want to set / change the "Up direction" in GEOGRAPHICLOCATION settings through API, you can use
GeoLocationData.UpDirection
GeoLocationData
Class is available in AutoCAD .NET API
- Autodesk.AutoCAD.DatabaseServices.GeoLocationData
Here is a C#
code snippet which demonstrates how to change "Up direction" using :
// Access GeoLocationData
ObjectId geoDataId = db.GeoDataObject;
//start a transaction
using (Transaction trans = db.TransactionManager.StartTransaction())
{
GeoLocationData geoLocdata = trans.GetObject(geoDataId, OpenMode.ForWrite) as GeoLocationData;
// Set the UpDirection
Vector3d vec3d = new Vector3d(0.0, 0.0, 1.00);
geoLocdata.UpDirection = vec3d;
trans.Commit();
}
Hope this is useful to you!


Leave a Reply