Hide all instances of a specific dimension style


#1

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.


#2

As i can see here there are only 3 elements.


#3

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.


#4

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)

#5

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.


#6

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


#7

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.


#8

Could you share with us your rvt file?


#9

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


#10

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

(Edit: I can spell)


#11

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.


#12

Can you post a screenshot of your DYN?


#13

Sorry for the delay in getting back to you:


#14

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.


#15

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.