Rename Views According to Level and Phase Name


#1

First off, thank you so much to those of you who have been generously answering my questions and providing custom nodes. Now for the question, I am close to making something which names views according to their Level and Phase. I have two main problems as I see it:

  1. I am not able to filter and separate the views by Phase. (Although I am using the BoolMask trick)

  2. My naming is not properly formatted.


#2

Try this


#3

This one should be a little more clearer.

I should point out that this does leave the potential for duplicate floor plan names. You may need to add something else to prevent that from happening. It can be done by adding one more thing into the List.Create.


#4

Thanks Steve, I’m going to give this a try!


#5

No problem hope it helps


#6

Thank you Steve, that really helped! I had to make one small edit. The ‘Level’ nodes kept giving me an error so I changed it to a ‘get parameter’ and used ‘Associated Level’ as the parameter. This thing is actually going to work!


#7

Mine was coming up blank thats why I changed it to what I did. Glad you were able to figure it out and its good to know that its “associated level” rather than just “level”.

I think this is a good script and with some small modification could potently create enlarged floor plans based on scope boxes.


#8

I am always making and naming Views so much that I need to figure out how to get Dynamo to do that for me. After I’ve run it a few times it’s a little buggy but we will celebrate the moment anyway:-). Time to refine it later…


#9


#10

Thanks Organon! Sorry for my ignorance but is that a Python Script? How would I run that? Or, what would I connect that to, to make it rename views?


#11

A DesignScript script. Connect the view list.


#12

Just goes to show what a real programmer can do in a few lines of code, nice. Thanks!


#13

Thanks, but i’m not a programmer; just an amateur.

This Python script doesn’t dislpay the dialog box:

import clr
 
 clr.AddReference('RevitAPI')
 from Autodesk.Revit.DB import *
 
 clr.AddReference("RevitServices")
 from RevitServices.Persistence import DocumentManager
 from RevitServices.Transactions import TransactionManager
 
 doc =  DocumentManager.Instance.CurrentDBDocument
 
 views = UnwrapElement(IN[0])
 
 names = list()
 
 TransactionManager.Instance.EnsureInTransaction(doc)
 
 for view in views:
     level = view.GenLevel.Name
     phase = view.get_Parameter(BuiltInParameter.VIEW_PHASE).AsValueString()
     view.Name = level + ' - ' + phase    
     names.append(view.Name)
     
 TransactionManager.Instance.TransactionTaskDone()    
     
 OUT = names

#14

Hi where do you have this component Get.All.Views?

I am trying to find a way of selecting multiple views and filter by Floor Plan subgroup parameters. Appreciate any help


#15

Michal,

It is in Archi-Lab. I would also recommend getting SpringNodes, Rhythm and Clockwork. They all have some really good nodes.