.NET

Reply
Contributor
Nk_long
Posts: 15
Registered: ‎05-31-2012
Message 1 of 8 (632 Views)
Accepted Solution

GetEntity with Filter

632 Views, 7 Replies
06-14-2012 01:14 AM

How to GetEntity with filter?

Thanks. With SelectionSet I know how to create filter with a SelectionFilter. I want to find method for GetEntity. I found it in sample from Mr Kean WalmSley. We use PromptEntityOptions.AddAllowedClass(). But it's only filter for class, not all properties like color, linetype, layer...

See detail at here >>>>>>> this link<<<<<<<<<

 

Regard,

*Expert Elite*
Alfred.NESWADBA
Posts: 9,575
Registered: ‎06-29-2007
Message 2 of 8 (630 Views)

Re: GetEntity with Filter

06-14-2012 01:24 AM in reply to: Nk_long

Hi,

 

does >>>this<<< help?

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
*Expert Elite*
chiefbraincloud
Posts: 753
Registered: ‎02-13-2008
Message 3 of 8 (603 Views)

Re: GetEntity with Filter

06-14-2012 08:57 AM in reply to: Alfred.NESWADBA

I believe this would be more appropriate:

http://through-the-interface.typepad.com/through_the_interface/2008/07/conditional-sel.html

Dave O.                                                                  Sig-Logos32.png
Contributor
Nk_long
Posts: 15
Registered: ‎05-31-2012
Message 4 of 8 (574 Views)

Re: GetEntity with Filter

06-14-2012 08:29 PM in reply to: chiefbraincloud

Thanks. With SelectionSet I know how to create filter with a SelectionFilter. I want to find method for GetEntity. I found it in sample from Mr Kean WalmSley. We use PromptEntityOptions.AddAllowedClass(). But it's only filter for class, not all properties like color, linetype, layer...

See detail at here >>>>>>> this link<<<<<<<<<

 

Regard,

Distinguished Contributor
eljobe
Posts: 706
Registered: ‎01-24-2003
Message 5 of 8 (550 Views)

Re: GetEntity with Filter

06-15-2012 08:21 AM in reply to: Nk_long

GetEntity will return a PromptEntityResult which contains the ObjectID of the entity selected. You can then open it for read and examine the ent's properties. If it doesn't meet your criteria, you can prompt them to select again.

Contributor
rmdw
Posts: 16
Registered: ‎04-04-2011
Message 6 of 8 (194 Views)

Re: GetEntity with Filter

05-22-2014 07:23 PM in reply to: Nk_long

I got all excited at being able to define a simple entity filter like which was possible with (ssget) in AutoLisp.  I started using his approach but then quickly discovered that entities like "3DFACE" don't appear to have Type Classes defined in .NET.


Robert

Distinguished Contributor
SEANT61
Posts: 137
Registered: ‎09-23-2008
Message 7 of 8 (168 Views)

Re: GetEntity with Filter

05-24-2014 03:36 AM in reply to: rmdw

Have yout tried:

 

PromptEntityOptions.AddAllowedClass(typeof(Face), true);

Distinguished Contributor
SEANT61
Posts: 137
Registered: ‎09-23-2008
Message 8 of 8 (165 Views)

Re: GetEntity with Filter

05-24-2014 03:49 AM in reply to: Nk_long

With regard to the original query of this thread (granted, the thread is a few years old), a method of advanced filtering for an individual entity was discussed in this thread.  If the OP is still around, the concept may be of some interest.

 

http://www.cadtutor.net/forum/showthread.php?41648

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.