.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
Anonymous
1737 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: Anonymous

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 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 3 of 4
Hallex
in reply to: Anonymous

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

Forma Design Contest


Autodesk Design & Make Report