.NET

Reply
Mentor
Rob.O
Posts: 259
Registered: ‎06-25-2007
Message 1 of 4 (395 Views)
Accepted Solution

Filter multiple object types

395 Views, 3 Replies
04-11-2012 12:18 PM

Hi all!

 

I have searched for info on how to filter multiple object types (here, the swamp, google, and the docs) and have come up empty handed.  I have code that filters out everything except for blocks (INSERT) with a few additional parameters to exclude blocks of a certain name, but I also need to include MULTILEADERS in the selection filter.

 

Here is the code I have for the INSERT filter:

 

acTypValAr = New TypedValue() {New TypedValue(DxfCode.Start, "INSERT"), New TypedValue(-4, "<NOT"), _
                                      New TypedValue(2, "BLOCKA,BLOCKB,BLOCKC,BLOCKD"), _
                                      New TypedValue(-4, "NOT>")}

 Any ideas on how to add MULTILEADERS to this selection filter as well?

Hi,

 

While the values are strings in a selection filter TypedValue, you can have multiple strings separated with commas (as with your block names):

new TypedValue(0, "INSERT,MULTILEADER");

 

The more complete documentation about selection filters is in the LISP docs:

Developer Documentation > AutoLISP Developer's Guide > Using the AutoLISP Language > Using AutoLISP to Manipulate AutoCAD Objects > Selection Set Handling > Selection Set Filter Lists and related topics. Just repalce LISP dotted pairs with TypedValues.

Valued Contributor
FFlix
Posts: 95
Registered: ‎11-15-2011
Message 2 of 4 (384 Views)

Re: Filter multiple object types

04-11-2012 01:28 PM in reply to: Rob.O

hi, have you tried adding 'New TypedValue(DxfCode.Start, "MLEADER")' into the parameter list?

 

(autodesk's dxf reference lists MLEADER in the same way as INSERT for blockreferences, along with further distinction into mleader context, mleader node and mleader line.)

*Expert Elite*
_gile
Posts: 2,114
Registered: ‎04-29-2006
Message 3 of 4 (378 Views)

Re : Filter multiple object types

04-11-2012 01:42 PM in reply to: Rob.O

Hi,

 

While the values are strings in a selection filter TypedValue, you can have multiple strings separated with commas (as with your block names):

new TypedValue(0, "INSERT,MULTILEADER");

 

The more complete documentation about selection filters is in the LISP docs:

Developer Documentation > AutoLISP Developer's Guide > Using the AutoLISP Language > Using AutoLISP to Manipulate AutoCAD Objects > Selection Set Handling > Selection Set Filter Lists and related topics. Just repalce LISP dotted pairs with TypedValues.

Gilles Chanteau
Mentor
Rob.O
Posts: 259
Registered: ‎06-25-2007
Message 4 of 4 (363 Views)

Re : Filter multiple object types

04-11-2012 03:05 PM in reply to: _gile

Perfect!  

 

I didn't even think of trying that Gile!

 

Thanks!

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!