.NET

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

How to set current layer

216 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,237
Registered: ‎03-13-2008
Message 2 of 4 (213 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 (202 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 (157 Views)

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
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.