Is there a way to unhide a single element from "Temporary Hide/Isolate" mode?

Is there a way to unhide a single element from "Temporary Hide/Isolate" mode?

DanielKP2Z9V
Advocate Advocate
1,325 Views
4 Replies
Message 1 of 5

Is there a way to unhide a single element from "Temporary Hide/Isolate" mode?

DanielKP2Z9V
Advocate
Advocate

Use case: a friend told me that's it's a common issue to select a bunch of elements, press "temporary hide isolate" only to forget to include section box in the selection. Now selection has to be redone, because after undoing "temporary hide isolate" this specific selection of elements is lost. While you could create a temporary selection set to get around it, I'm looking for a way to "unhide" specific elements. Does Revit API provide such method? I couldn't find anything like this so far.

0 Likes
Accepted solutions (2)
1,326 Views
4 Replies
Replies (4)
Message 2 of 5

jeremy_tammik
Alumni
Alumni
Accepted solution

I guess you could easily implement what you describe with an add-in that asks for the selection, keeps track of it, hides and unhides it for you, and also provides options to add and remove individual elements from the set. I don't think there is any need for additional functionality from the official API to enable this, because all you need is already there and waiting for you.

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 5

DanielKP2Z9V
Advocate
Advocate

Thank you, but I'm a bit concerned over keeping additional state parallel to the state that already exists in revit. I did that to manage opened views, but it ran into issues with Revit API incorrectly reporting when a view was closed leading to occasional i̶n̷c̵o̵n̴s̷i̷s̸t̷e̸n̶c̴i̷e̴s̵.

 

I'd be keen on adding such methods to native Revit API, but it's not a dealbreaker.

0 Likes
Message 4 of 5

TripleM-Dev.net
Advisor
Advisor
Accepted solution

Could be done like making you're own "Reveal" function.

If elements are temporary hidden but a few no longer should be then the following workflow in API could do it:

Command A:

1. retrieve all temp. hidden elements, and save the Id's in a shared list

2. restore all elements (reset the temp. hidden state)

3. save the view id (and/or doc Hash) in a shared variable (could be combined with the Shared list of 1, this way the function could work on multiple views, a custom class that holds this info)

 

Command B:

1. Ask for elements to no longer be temp. hidden (highlight the hidden elements or something, or even hide all other elements...

2. afther this apply the original temporary hidden state but first remove the id's above form the Shared list.

(Correct shared list should then be retrieved from the view id + doc hash, doc hash to support multiple documents for this command)

 

I have something like this, but for selections themself (sort of virtual selection, to which elements can be added, removed, combined/union operation etc. without having the selection active)

 

OR just use "Select Previous" after resetting the emporary hide state manually in the UI.

As long as the esc. button wasn't pressed that option is available (right -click in view, in menu select "Select previous". After this the selection can be edited (add element) and Temp hide/isolate can be used.

 

- Michel

0 Likes
Message 5 of 5

DanielKP2Z9V
Advocate
Advocate

Oh ok, I see now what you and Jeremy had in mind. Store currently visible elements, reveal all, add section box id, hide everything else. That's probably the best way to do it. I don't know revit internals enough to judge if there could be a more efficient way to do it, but this might be just fine. 

0 Likes