.NET

Reply
Valued Contributor
Nawara17
Posts: 52
Registered: ‎03-27-2006
Message 1 of 7 (84 Views)

entity.get_Layer()

84 Views, 6 Replies
07-23-2006 06:05 PM
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
*Tony Tanzillo
Message 2 of 7 (84 Views)

Re: entity.get_Layer()

07-23-2006 06:26 PM 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
Valued Contributor
Nawara17
Posts: 52
Registered: ‎03-27-2006
Message 3 of 7 (84 Views)

Re: entity.get_Layer()

07-24-2006 12:23 PM in reply to: Nawara17
I am using autocad2006
*Norman Yuan
Message 4 of 7 (84 Views)

Re: entity.get_Layer()

07-24-2006 04:29 PM 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
Valued Contributor
Nawara17
Posts: 52
Registered: ‎03-27-2006
Message 5 of 7 (84 Views)

Re: entity.get_Layer()

07-24-2006 05:19 PM 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.
*Tony Tanzillo
Message 6 of 7 (84 Views)

Re: entity.get_Layer()

07-24-2006 05:46 PM 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.
Valued Contributor
Nawara17
Posts: 52
Registered: ‎03-27-2006
Message 7 of 7 (84 Views)

Re: entity.get_Layer()

07-25-2006 08:01 AM in reply to: Nawara17
Thanks Tony.
It works :smileyhappy:
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!