In AutoCAD Map 3D UI, we can easily change / set the View Scale by specifying a new / custom scale value using the dropdown button next to the "View Scale" as shown in the screenshot below –
You can achieve the same using Map 3D Platform API AcMapMap.SetViewScale(double scale). Here is a .NET code snippet which demonstrates the same :
// Get the Map Object
AcMapMap currentMap = AcMapMap.GetCurrentMap();
Double viewScale = currentMap.GetViewScale();
ed.WriteMessage("ViewScale Before Change : " + viewScale.ToString());
// set the ViewScale
viewScale = (viewScale / 100);
currentMap.SetViewScale(viewScale);
ed.WriteMessage("ViewScale After Change : " + viewScale.ToString());
And the result you would see after running in the above code snippet :
Hope this is useful to you!



Leave a Reply