.NET

Reply
Valued Contributor
87 Posts
0 Kudos
Registered: ‎05-03-2013
Post 1 of 4
Accepted Solution

How to set current layer

222 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*
1,277 Posts
109 Kudos
Registered: ‎03-13-2008
Post 2 of 4

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
61 Posts
0 Kudos
Registered: ‎11-19-2010
Post 3 of 4

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
87 Posts
0 Kudos
Registered: ‎05-03-2013
Post 4 of 4

Re: How to set current layer

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

:smileyembarrassed:Thanks for your help

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!