.NET

Reply
Active Contributor
bolek75
Posts: 28
Registered: ‎11-29-2005
Message 1 of 4 (72 Views)

How to get the layer of an Entity

72 Views, 3 Replies
11-29-2005 05:27 AM
Hi NG,

I fetch an Entity object like this:

Entity ent = (Entity)trans.GetObject(flstObj,OpenMode.ForRead);

and would like to get the name of the layer the entity is on. When calling ent.get_Layer() I get the compiler error, which is something lke this:

Operator or Accessor cannot be called explicit

What to do? Can somebody help? I am using C#.

Regards
bolek75
*Kerry Brown
Message 2 of 4 (72 Views)

Re: How to get the layer of an Entity

11-29-2005 05:59 AM in reply to: bolek75
Perhaps this :-

string layerName = ent.Layer;


wrote in message news:5024243@discussion.autodesk.com...
Hi NG,

I fetch an Entity object like this:

Entity ent = (Entity)trans.GetObject(flstObj,OpenMode.ForRead);

and would like to get the name of the layer the entity is on. When calling
ent.get_Layer() I get the compiler error, which is something lke this:

Operator or Accessor cannot be called explicit

What to do? Can somebody help? I am using C#.

Regards
bolek75
Active Contributor
bolek75
Posts: 28
Registered: ‎11-29-2005
Message 3 of 4 (72 Views)

Re: How to get the layer of an Entity

11-29-2005 06:26 AM in reply to: bolek75
Hi Kerry,

you are right, it works. But why does the f.. Intellisense of the IDE does not show this property in the list?

Cheers
bolek75
Active Contributor
bolek75
Posts: 28
Registered: ‎11-29-2005
Message 4 of 4 (72 Views)

Re: How to get the layer of an Entity

11-29-2005 06:32 AM in reply to: bolek75
ok, oh right.
I see, the get_ and set_ methods are the accessor-methods which I cant invoke directly. Instead I have to use the property.

Cheers
bolek75

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community