.NET

Reply
Valued Contributor
HelloWorlddd
Posts: 87
Registered: ‎05-03-2013
Message 1 of 4 (196 Views)
Accepted Solution

How to set current layer

196 Views, 3 Replies
03-31-2014 04:19 AM

How to set current layer to a specified layer? I mean use program complete this function.

For example there is a new layer called "myLayer", then I execute  a command, the currrent layer will be"myLayer".


Any help much appreciated.

The easiest way to set the current layer is to modify the CLAYER system variable.

 

Application.SetSystemVariable("CLAYER", "myLayer");

 

*Expert Elite*
Keith.Brown
Posts: 1,153
Registered: ‎03-13-2008
Message 2 of 4 (193 Views)

Re: How to set current layer

03-31-2014 04:30 AM in reply to: HelloWorlddd

The easiest way to set the current layer is to modify the CLAYER system variable.

 

Application.SetSystemVariable("CLAYER", "myLayer");

 


Keith Brown AutoCAD MEP BLOG | RSS Feed
AutoCAD MEP 2014 | Revit 2014 | EastCoast CAD/CAM V6.1 | Visual Studio 2013
────────────────────────────────────
⁞|⁞ Please use Mark Solutions!.Accept as Solution and Give Kudos!Give Kudos as appropriate. Thank you!
Valued Contributor
cdinten
Posts: 61
Registered: ‎11-19-2010
Message 3 of 4 (182 Views)

Re: How to set current layer

03-31-2014 05:02 AM in reply to: HelloWorlddd
another way is using Database.Clayer property
you just set your specified layer's objectid to this property
Valued Contributor
HelloWorlddd
Posts: 87
Registered: ‎05-03-2013
Message 4 of 4 (137 Views)

Re: How to set current layer

04-01-2014 04:52 AM in reply to: Keith.Brown

:smileyembarrassed:Thanks for your help

Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.