.NET

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

How to set current layer

190 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.

*Expert Elite*
Keith.Brown
Posts: 1,130
Registered: ‎03-13-2008
Message 2 of 4 (187 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 (176 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 (131 Views)

Re: How to set current layer

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

:smileyembarrassed:Thanks for your help

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

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