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

Current Layer Name

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
spu
Advocate
1527 Views, 3 Replies

Current Layer Name

Hi,

 

I know acCurDb.Clayer will give the ObjectId of active layer but friends how to get the current layer name.

 

This may be really silly but i had spent lot of time to find and can't get a good solution. Please help....

 

Regards,

Shijith

 

 

Tags (1)
3 REPLIES 3
Message 2 of 4
Alfred.NESWADBA
in reply to: spu

Hi,

 

open the object for the ObjectID, that resulting type is a LayerTableRecord, and now you have access tp a property "Name" and that is the layername.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 4
Hallex
in reply to: spu

If you want to give just current layer name try this code as well

        [CommandMethod("curlayer")]
        public void DisplayCurrLayerName()
        {
            MessageBox.Show(Autodesk.AutoCAD.ApplicationServices.Application.GetSystemVariable("clayer").ToString());
        }

 

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 4 of 4
spu
Advocate
in reply to: Hallex

Hi,

 

Both solutions where perfect...

 

Thanks

 

Regards,

Shijith

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