Skip to main content
1-Visitor
July 9, 2015
Question

Selection Buffer. Selection Listener. Selection filters

  • July 9, 2015
  • 2 replies
  • 1661 views

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 ?

    2 replies

    15-Moonstone
    July 14, 2015

    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

    amedina-21-VisitorAuthor
    1-Visitor
    July 14, 2015

    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.

    15-Moonstone
    July 14, 2015

    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