Author Topic: how to add entity into selectionset?  (Read 813 times)

0 Members and 1 Guest are viewing this topic.

guohq

  • Newt
  • Posts: 75
how to add entity into selectionset?
« on: July 25, 2016, 12:42:00 AM »
how to add entity into selectionset then I can use SelectPrevious  method to select these entities next time.

SelectionSet.FromObjectIds  only return a selectionset .

MexicanCustard

  • Swamp Rat
  • Posts: 702
Re: how to add entity into selectionset?
« Reply #1 on: July 25, 2016, 08:17:39 AM »
Editor.SetImpliedSelection
Revit 2019, AMEP 2019 64bit Win 10

guohq

  • Newt
  • Posts: 75
Re: how to add entity into selectionset?
« Reply #2 on: July 25, 2016, 08:52:17 PM »
Thank you .But Editor.SetImpliedSelection can not add entity to previous selectionset.

MexicanCustard

  • Swamp Rat
  • Posts: 702
Re: how to add entity into selectionset?
« Reply #3 on: July 26, 2016, 07:17:02 AM »
I guess I'm not understanding the question.  A SelectionSet at its core is just an ObjectId[]. So when you say add to a SelectionSet you just add the additional ObjectIds to an ObjectId[].  You can collect many SelectionSets combine them all into another ObjectId[] and set the current selection to this array using Editor.SetImpliedSelection. After setting the current selection, SelectPrevious will now pick the objects that were in your ObjectId[].
Revit 2019, AMEP 2019 64bit Win 10

guohq

  • Newt
  • Posts: 75
Re: how to add entity into selectionset?
« Reply #4 on: April 20, 2018, 11:15:49 AM »
I find the anwser!

you can try like below


Dim IDSet  as SelectionSet = .......

Doc.Editor.SetImpliedSelection(IdSet)
Doc.Editor.GetSelection()

then ,you can  use  "P" when you select something