Hide all instances of a specific dimension style

Greetings,

I found the following thread but I was hoping a new thread may keeps things clear.

I was able to hide all instances of a specific dimension style throughout the views in the my project.

After I have run the Hide Elements node, I have not been able to get all of the elements to unhide via the Unhide Node. One of the three test elements does unhide but not the other two.

I’ve tried closing Dynamo and re-running the Unhide Node but nothing seems to work. I have to manually go into the views in Revit and unhide the dimension instances.

Any advice is appreciated!

Thank you,
Thom K.

As i can see here there are only 3 elements.

Yes, this was just a small test. There are only three elements. All three hide consistently. Only 1 will unhide and the other two remain hidden. That is also consistent.

Thanks again,
T.K.

Try this python code.

import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from System.Collections.Generic import *

clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
elements = UnwrapElement(IN[0])
view = UnwrapElement(IN[1])
ids = list()
elementlist = list()
for item in elements:
	ids.append(item.Id)
ielements = List[ElementId](ids)

TransactionManager.Instance.EnsureInTransaction(doc)
#Unhide Elements
view.UnhideElements(ielements)
TransactionManager.Instance.TransactionTaskDone()
OUT = (view,elements)
1 Like

Thank you very much for the code!

I’m getting the following warning:

I’m assuming I should connect the list of elements to IN[0] and all the views in the document to IN[1].

Is the OUT to be connected to something else?

Thanks again,
Thom K.

I am not near my pc. Can you show me values of Document.Views?

It appears to be listing all of the views in the model.

Would it be more efficient to extract just the views that the specific elements are in and feed that into the hide/unhide?

This seems to be doing more of a brute-force attack.

Thanks again,
Thom K.

Could you share with us your rvt file?

https://1drv.ms/u/s!Aj_eANj-APxvx3EQwc3a6g_vb-qc

Get the workset of the dims and use that to filter the views you hide and unhindered them in.

(Edit: I can spell)

Thanks for the response, I can see the Workset parameter for the dimensions with Element,Parameters, but I can’t seem to extract it out to filter it to the View.UnhideElements node.

Thanks again,
Thom K.

Can you post a screenshot of your DYN?

Sorry for the delay in getting back to you:

Ah. I was referring to the script which you were using to get the workset. If I can fit it in I’ll try and find some time to review this later.

Got ya: The Document.Views is just pulling all of the views and that’s passing into the View.UnhideElements node.

I can’t figure out why the View.HideElements works consistently and completely but the View.UnhideElements will only unhide the one element.

In any case, I certainly appreciate any effort you can help me with!

Thanks again,
Thom K.

Okay, it’s been a while and I think I finally put all the pieces together to make this do what I wanted to.

Attached is the file that I was able to cobble together.

This only hides/unhides for views that are on sheets as the idea is that you may have a Coordination Dimension Style that you use for checking shop drawings.

Hope this helps someone although that’s probably a stretch!

Thom K.
Hide or Unhide Dimension Type on Sheets.dyn (60.9 KB)

Dear Thom_Krejci.

I want to test and try your script but i got a message that it is corrupt.

Please can you renew this script so i can try it.

Best Regards,

Olaf K

File looks fine to me. Are you using Dynamo 1.x perhaps? The graph was written for 2.0.

Hide or Unhide Dimension Type on Sheets v2.1.dyn (62.3 KB)

The Hide/Unhide appears to have changed.

Here’s an updated version using a Quasar node and a slightly different Hide/Unhide toggle.

Thanks for the quick response Jacob!

-Thom K.

Thom,

Thank you very much.

And yes i was using dynamo 1.3 but i will install 2.0.

Best Regards,

Olaf K