System variable for rotation last angle?
The ROTATE command shows a default rotation angle in the prompt asking the USER to specify the angle or accept the default. I want to access this last used rotation angle in a lisp routine. I have unsuccessfully searched the help and developer's guides but have come up empty handed. Is this angle accessible to the USER?
Comments
-
(getvar 'lastangle) ?
Answer will be in radians but displayed as per units setting on command line.
0 -
@ALANH thanks for thinking about this. I saw lastangle yesterday while scanning the system variables but it pertains to the last arc angle. A simple test of the rotate command indicated a different value than lastangle.
I will simply create a global variable for my lisp.
0 -
It's curious that there's no openly acknowledged system variable for something that's clearly being saved. Why would you keep it secret?
A Google search for "last angle used by the rotate command" yielded this AI Overview: "The last rotation angle used with the AutoCAD ROTATE command is not stored as a specific system variable."
I searched the references given for that AI Overview, but couldn't see where it came from.
Experimentation seems to confirm it. I rotated something 13.34 degrees, and then searched the Settings dialog for that number and for its radian equivalent 0.23282692.
I also searched my registry for 13.34 and 0.23282692.
I saved the file as ASCII DXF and searched that too.
Experimentation shows that the saved value isn't displayed by the Rotate command in another drawing file, nor in the same file during a subsequent session.
0 -
@Anthony Apostolaros Thanks for your great effort! I am going with my own global variable and be done with it.
However, out of general curiosity, your investigation seems to reveal that the value IS stored in the drawing file but NOT saved with the file. This seems to be the same behavior as a lisp global variable.
0 -
The last angle entered in response to the Rotate command is saved in the command history, so I wondered if maybe the Rotate command searches the command history to get the last value. That would be a strange and time-consuming way to do it, as compared with using a variable. But experimentation with the Textscr command suggests that the command history is the same for all open files. Since the Rotate command doesn't recall the last angle in other open files, that must not be what's going on. It must be a secret variable.
It's apparently a secret in all DWG-based cad applications, so I guess it's being kept secret for national security reasons.
1