.NET

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

How to get the layer of an Entity

75 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 (75 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 (75 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 (75 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.