Inventor Customization

Reply
Distinguished Contributor
TONELLAL
Posts: 142
Registered: ‎01-17-2010
Message 1 of 3 (154 Views)

Filter a selectset

154 Views, 2 Replies
01-23-2013 08:27 AM

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 !

 

Mentor
krieg
Posts: 176
Registered: ‎11-22-2009
Message 2 of 3 (147 Views)

Re: Filter a selectset

01-23-2013 12:47 PM 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.

ADN Support Specialist
xiaodong.liang
Posts: 1,260
Registered: ‎06-12-2011
Message 3 of 3 (126 Views)

Re: Filter a selectset

01-28-2013 12:39 AM in reply to: krieg

Hi,

 

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

kDrawingBalloonFilter = 16906


Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube