Get Levels from a linked file and keep the type (Black and Blue)

I know how to get the levels in from a linked Revit file, but what I am wondering is can you also make the levels copy weather they are Black and Blue ( blue headers have a view associated with them whereas black headers don’t).

and to take it further to rename the level that is on 0’-0"to the linked file


Levels.dyn (7.0 KB)

OK I guess I can only either copy all the linked files to the project (Black which does not have a view associated with it) or Blue to create Views from the links but not both. Here is what I have so far I am ok with all of them being blue but I still need to filter out the ones on the same level and rename the Project one to match the link ( FE. Level 1 renamed to Finished Floor)

You can use FindAssociatedPlanViewId to determine whether the level has associated views or not. Basically you just need to work through the logic flow of handling all these things at once.

  1. Copy linked levels.
  2. Check to see if linked levels have associated views.
  3. Create views for new levels as needed.
  4. Confirm matching names/elevations between linked and local levels. (Rename mismatched levels.)
1 Like

So now I am even more confused than normal lol.
How do you use dynamo to see if a linked file has associated views to them. I am guessing you are talking about a python script, correct?

Correct. That’s the method I linked. It returns the ViewId of the first associated view of the level. If there is no Id, there are no associated views.

1 Like

Since I am a NOOB to writing python doesn’t Clockwork Package Element.ID+ do that for you?

That just gets you an element Id from an element. This specifically gets the Id of the view associated with the level. The view is the important part.

1 Like

OK I think I have it I know there is a shorter way and using Nick way but I just cant get my head around python lol.

here is the script if anyone is interested. and Nick if you can make it better be my guest. I couldn’t figure out the White and Blue so I made them worst case and all is Blue lol.

Let me know your thoughts
Link File and Levels_script.dyn (107.7 KB)