Current Layer Name

Current Layer Name

Anonymous
Not applicable
2,239 Views
3 Replies
Message 1 of 4

Current Layer Name

Anonymous
Not applicable

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

 

 

0 Likes
Accepted solutions (1)
2,240 Views
3 Replies
Replies (3)
Message 2 of 4

Alfred.NESWADBA
Consultant
Consultant

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
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 3 of 4

Hallex
Advisor
Advisor
Accepted solution

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

Anonymous
Not applicable

Hi,

 

Both solutions where perfect...

 

Thanks

 

Regards,

Shijith

0 Likes