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

entity.get_Layer()

6 REPLIES 6
Reply
Message 1 of 7
Nawara17
297 Views, 6 Replies

entity.get_Layer()

anybody knows why entity.get_layer() cannot be used explicity?

I am trying to get an entity's layer name. but when I use ent.get_layer(), the following error appear:
'Autodesk.AutoCAD.DatabaseServices.Entity.Layer.get': cannot explicitly call operator or accessor

and if I used ent.Layer as I saw in other topics in this discussions, it seems that it doesn't defined in my project. it is not appearing in ent properties list and it gives this error:
'Autodesk.AutoCAD.DatabaseServices.Entity' does not contain a definition for 'layer'

BTW, I am using VS2003, C#.

thanks in advance

Noora
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Nawara17

There's been quite a bit of confusion here as a result
of people posting questions but not mentioning what
release of AutoCAD they're working with.

The differences are significant between 2005 and
2006 (and I'm finding that in 2007/VS2005, there
are massive problems with code that worked fine
in 2006/VS2003).

So, for starters, what release of AutoCAD is that ?



--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5245736@discussion.autodesk.com...
anybody knows why entity.get_layer() cannot be used explicity?

I am trying to get an entity's layer name. but when I use ent.get_layer(), the following error appear:
'Autodesk.AutoCAD.DatabaseServices.Entity.Layer.get': cannot explicitly call operator or accessor

and if I used ent.Layer as I saw in other topics in this discussions, it seems that it doesn't defined in my project. it is not appearing in ent properties list and it gives this error:
'Autodesk.AutoCAD.DatabaseServices.Entity' does not contain a definition for 'layer'

BTW, I am using VS2003, C#.

thanks in advance

Noora
Message 3 of 7
Nawara17
in reply to: Nawara17

I am using autocad2006
Message 4 of 7
Anonymous
in reply to: Nawara17

Autodesk.AutoCAD.DatabaseServices.Entity does have a string property "Layer"
in Acad2006.

wrote in message news:5246568@discussion.autodesk.com...
I am using autocad2006
Message 5 of 7
Nawara17
in reply to: Nawara17

ya, but I think the problem is with VS2003.

becuase I opened my project in VC# 2005 Express edition, and i used layer property it doesn't give me an error and it works, but in VS2003 it seems that this property is not defined there.

I don't know how to solve this bug? becuase i want to create my project using VS2003.
Message 6 of 7
Anonymous
in reply to: Nawara17

Intellisense in 2003 has problems.

You may not see it listed, but it certainly is there
and it works.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5246916@discussion.autodesk.com...
ya, but I think the problem is with VS2003.

becuase I opened my project in VC# 2005 Express edition, and i used layer property it doesn't give me an error and it works, but in VS2003 it seems that this property is not defined there.

I don't know how to solve this bug? becuase i want to create my project using VS2003.
Message 7 of 7
Nawara17
in reply to: Nawara17

Thanks Tony.
It works 🙂

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