cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Selection Buffer. Selection Listener. Selection filters

amedina-2
1-Newbie

Selection Buffer. Selection Listener. Selection filters

In OTK we have pfcSession->GetCurrentSelectionBuffer() to get current selections on model, but I can't found how to change current selection filter without using pfcSession->Select(pfcSelectionOptions_ptr). And is there any action listeners like "On something select" or so ?

3 REPLIES 3

In TK there is a command namend : ProSelbufferSelectionAdd

so I think in OTK you need to get the current Buffer and add a selection like :

getCurrentSelectionBuffer()->AddSelection(pfcSelection selection);

From the OTK-API-Guide:   

pfcSelectionBuffer::AddSelection

Use the method pfcSelectionBuffer::AddSelection to add an item to the currently active selection buffer.

Note

The selected item must refer to an item that is in the current model such as its owner, component path or drawing view.

This method may fail due to any of the following reasons:

- There is no current selection buffer active.

- The selection does not refer to the current model.

- The item is not currently displayed and so cannot be added to the buffer.

- The selection cannot be added to the buffer in combination with one or more objects that are already in the buffer. For example: geometry and features cannot be selected in the default buffer at the same time.

Br,

Eike

yep, but i don't need to set selections into the buffer I want to get buffer values  when I select something in model window, something like action listener "after selection". I'm trying now to implement it through "ProSelectionPostSelact" and call ProSelect() in it. I hope to get recursive call and stop it when user  press "OK" or "CANCEL" on my custom dialog. In result I want get :

select on model - > add item in map or other collection,

select with pressed "Ctrl" -> append to collection,

select without "Ctrl" -> replace existing element.

So in result will be dialog like Load or Constraint creation where user can select items and the list in parent window will be filled just after selection made.

I don't think you can't change the filter without pfcSession->Select(pfcSelectionOptions_ptr). You only can use a mapkey or something like that, but thats not a nice solution because the user can change it back.

Br,

Eike

Announcements
Business Continuity with Creo: Learn more about it here.

Top Tags