We have created several "quick keys" in lisp that thaw specific layers of a drawing, ex: Typing 1Q will thaw all the layers corresponding to the first floor of a house and freeze every other layer.
I want to use these quick keys in .NET by using ...ActiveDocument.SendCommand. It works however, after running the command and querying for the ActiveLayer it doesn't return what is the current layer. I'm figuring that I am missing updating the layer table or model space. Any ideas or suggestions will be greatly appreciated.
.NET example:
Dim acadApp As AcadApplication
acadApp = CType(Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication, AcadApplication)
acadApp.ActiveDocument.SendCommand("1q" & " ")
MsgBox(acadApp.ActiveDocument.ActiveLayer.Name)
---> This returns "FP1" which is correct for the current active layer <---
acadApp.ActiveDocument.SendCommand("1ev" & " ")
MsgBox(acadApp.ActiveDocument.ActiveLayer.Name)
--> This returns "SH1" which is incorrect; SH1 is frozen by the "1EV" command