Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Filter a selectset

2 REPLIES 2
Reply
Message 1 of 3
TONELLAL
350 Views, 2 Replies

Filter a selectset

Hello,

I need to filter a selectset, in order to have only the objects I need (here balloons) in a collection.

I tried to test using "Typeof", the problem is some objects in the selectset are "empty".

What are thes "empty" objects ? And, more important, how can I found them ?

My current code is :

 

*******************************

Dim oSelection As SelectSet

Dim oSelectedBalloons As New Collection

Dim selectedObj As Object

 

Set oDoc = ThisApplication.ActiveDocument

Set oSelection = oDoc.SelectSet

 

For Each selectedObj In oSelection

If TypeOf selectedObj Is Balloon Then oSelectedBalloons.Add selectedObj

Next

********************************

This function if objects in the selectset are not empty.

How can I adapt it for empty objects ? Something like "if selectedObj = Nothing..."

 

Any idea welcome !

 

2 REPLIES 2
Message 2 of 3
Ralf_Krieg
in reply to: TONELLAL

Hello

 

Try to enable a selectionfilter. Take a look at inventor programmers help and search for "AddSelectionFilter". There is a window selection example, which you can adept by changing the selectionfiltetypeenum.

So you don't have to "clean" your selection.


R. Krieg
RKW Solutions GmbH
www.rkw-solutions.com
Message 3 of 3
xiaodong_liang
in reply to: Ralf_Krieg

Hi,

 

Krieg is correct. In this case the filter enum is: 

kDrawingBalloonFilter = 16906

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report