Using PickObjects on Project Browser Elements (Sheets)

Using PickObjects on Project Browser Elements (Sheets)

Anonymous
Not applicable
1,247 Views
3 Replies
Message 1 of 4

Using PickObjects on Project Browser Elements (Sheets)

Anonymous
Not applicable

Hello,

 

I just found out about the PickObjects method and thought it would be very useful in quick functions, saving me time from creating windows forms for simple user input. I'm creating a plugin where I need to select multiple sheets, and noticed that when I use the PickObjects method the whole project browser gets greyed out. Any way of stopping this?

 

Here is the code that causes it:

 

IList<Reference> pickSheets = choices.PickObjects(ObjectType.Element);

 

Thanks!

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

matthew_taylor
Advisor
Advisor

Hello @Anonymous,

You may pre-select sheets/views, and they will be included in the current selection.

Use docUi.Selection.GetElementIds, and check that they're view elements.

 

 


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
0 Likes
Message 3 of 4

d.conroy
Explorer
Explorer

Hi Mathew,

I know it's an old(ish) thread, but when I use docUi.Selection.GetElementIds the collection only contains elements selected in the model, not the sheets and views selected in the Project Browser. Any ideas on how to get the list of selected items in the PB would be a great help.

Many thanks.

Dan

0 Likes
Message 4 of 4

matthew_taylor
Advisor
Advisor

Hi Dan,

The active view should be the project browser, and nothing should be selected in the graphical view.

If you're using the Add-In Manager to debug/test (and/or using keyboard shortcuts), then that's probably the issue. I always found it problematic. Try testing that part in the end user context; you may have more luck.


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
0 Likes