Sub-Assembly Selection Filter

Sub-Assembly Selection Filter

brotherhogue
Contributor Contributor
490 Views
1 Reply
Message 1 of 2

Sub-Assembly Selection Filter

brotherhogue
Contributor
Contributor

Is it possible to set up a selection filter that ignores part-type components and only targets occurrences that are assemblies? kAssemblyLeafOccurrenceFilter and kAssemblyOccurrenceFilter aren't helpful. If this filter doesn't exist, can someone think of a workaround? I only want the user to be able to select assemblies.

491 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

Hi @brotherhogue.  Since there is no variation of the SelectionFilterEnum for that specific request, it would likely require creating a whole special Class block of code, capable of 'handling' Inventor API Events, then start a selection session, rely on an event handler to 'react' to selection actions, and use your own internal selection filtering process within that event handler, to make it not possible to add those specific types of selections to the documents current SelectSet.  Long and complicated, but likely not impossible.

 

If you want to keep is simpler though, you could simply check the ComponentOccurrence that gets 'Picked', and if it does not meet your criteria, do not do anything with it, and/or continue letting them 'Pick' another/more.  Maybe, if using some sort of collection object, and adding the Picked ones into that collection for processing later, you could just not put the ones that do not meet your criteria into the collection.  Just throwing some ideas around

Are you familiar with the process of 'handling' Inventor API events?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes