iLogic: Allow multiple filters for the Pick function

iLogic: Allow multiple filters for the Pick function

DRoam
Mentor Mentor
1,323 Views
3 Replies
Message 1 of 4

iLogic: Allow multiple filters for the Pick function

DRoam
Mentor
Mentor

I know I can use the Pick function to select objects using iLogic. I know the filter for Planes is "SelectionFilterEnum.kWorkPlaneFilter", and for Sketches it's "SelectionFilterEnum.kSketchObjectFilter".

 

But what if I want to have a pick function that will allow me to select a plane OR a sketch? Is there any way to specify multiple filters for a Pick function? Something like:

 

ThisApplication.CommandManager.Pick(SelectionFilterEnum.kWorkPlaneFilter & SelectionFilterEnum.kSketchObjectFilter,"Select a Plane or Sketch:")

 

Is this possible? If not, can I specify a "filter" that will allow me to select anything, so I can select either a plane or a sketch and then just give an error if something else is selected?

0 Likes
1,324 Views
3 Replies
Replies (3)
Message 2 of 4

Jef_E
Collaborator
Collaborator

I don't know about selecting multiple object types with a filter.

 

This filter allows you to select anything.

kAllEntitiesFilter 18439 All entities filter(all entities should be selectable). 

Maybe you could create your own "Pick fuction" but it will be a bit more complicated 😄



Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
0 Likes
Message 3 of 4

frederic.vandenplas
Collaborator
Collaborator

Hi,

 

This filter is probably better to use

 

ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities, "Select a Plane or Sketch:")
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
0 Likes
Message 4 of 4

SometimesInventorMakesMeAngry
Advocate
Advocate
Can you explain how one would do this? I can write the code, I just need a direction.

I'm writing a small macro to add measuring functionality and I need several different entity types to be selectable.
0 Likes