.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Active Layer

0 REPLIES 0
Reply
Message 1 of 1
sapersing
254 Views, 0 Replies

Active Layer

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
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost