Ad

Monday, May 17, 2021

Coordinate System - Status Bar

 It would be useful to show the coordinate system in the status bar. 

One way to accomplish the task is to use the Map command MAPSTATUSBAR and set the value to SHOW. 


This, unfortunately, adds a bunch of other junk that is most likely not wanted, especially when using a small monitor. 

Another way to accomplish the task is to add the information using ModeMacro. This allows you to populate a box on the StatusBar with information. To do so in LISP, you could copy and paste this line to the command line: 

(setvar "MODEMACRO" (getvar "CGEOCS"))

 This will get the current coordinate system string and add it to the ModeMacro field. 

To clear the value you can use the following line that will remove the coordinate system:

(setvar "MODEMACRO" "")

You can then expand the concept with more advanced code that tracks when the coordinate system changes, using PointMonitor. 

This blog post has an example of using the PointMonitor: 

    https://www.tek1.com.au/point-monitor-hello-world-autocad-net-api/ 

To get and set variables you can use the following code: 

var coordCode = Application.GetSystemVariable("CGEOCS");

Application.SetSystemVariable("MODEMACRO" coordCode);

No comments:

LinkWithin

Blog Widget by LinkWithin

Ad