Multiple ObjectType values for one PickObjects method run

Hello everyone. I’m fairly new to pyRevit and Python and still actively learning, so please excuse me if this is a silly question.
Is it possible to give two values for an objectType argument inside of a PickObject method? I’m trying to prompt the user to select elements both from the current project and from a Revit Link. Basically, what I’m trying to do is:
for i in revit.uidoc.Selection.PickObjects([ObjectType.Element, ObjectType.LinkedElement]), but it’s not working nor with lists, nor with tuples.
I’ve already came up with some workarounds (prompting the user two times, etc), but just wanted to make sure if it’s possible to make in a single run or not.
Thank you in advance! :smile:

You can only provide arguments as specified in the Revit API Docs

In case of PickObjects you can only provide ObjectType once. I think prompting selection twice is the best option to get both Project and Linked elements.

What kind of tool are you making that you need both project and linked elements?

1 Like

Hello Erik, and thank you for making this clear, as well as for introducing me to pyRevit :slight_smile:

I think prompting selection twice is the best option to get both Project and Linked elements

Yes, that’s what I decided to do for now and since it’s impossible to prompt both in a single run, I’ll leave it at that.

I’m currently making a tool that will fill out a given annotation (made for this exact occasion) with names of materials used in compound structures, as well as their widths.

1 Like