Change target view of view reference family

Hello!

Is there a way to change the target view of a view reference family?
I have to place couple thousand and I really don’t want to do it manually.

Thanks

What’s the storage type of the parameter in question?

It showed me ElementID but with the ID node it reported wrong data type. I have inputted the view not it gives read only parameter error.

Reviving an old thread here but im sure it will come in handy. It can be done using dynamo (sort of).

Since the parameter for the target view is read only, we have to accept the fact that nothing can be done as far as writing the parameter goes (to my knowlege nothing has changed in newer versions).

However, we can still read the parameters and use that information to sort view references based on whether they are correctly referencing views. When we have a list of what isnt correctly referenced, we can select these through dynamo and reassign in revit.

Here is my workflow.

Lets say you have a floor plan split into 4 dependant views. I typically use scope boxes and dynamo to create my views, and this adds the scope box name to the end of my views.

When adding view references, create a new type for each scope box and label it the same as the scope box name. So every view reference that should reference a view ending in “scope box 1” should be of type “scope box 1”

Once you have view references all set up with their respective types, duplicate across other parent floor plans.

We now have floor plans with the respective scope box name appended to the end and view references with the type named after the target view scope box.

Into dynamo now, you want to create a script to collect all view references, get the target view, and then compare the target view name against the view reference type name. If the view name contains the view ref type name, that means they are correctly referenced and can be filtered out with a bool mask.

With the bool mask now, looking at the ‘out’ list for what isn’t matching, you’ll want to group references by workset name (if i recall correctly, this is to group by parent view).

From here, get the first item in a list (all the non matching references in a single view), and filter out by the first unique item from here (sorting the unique items list will also help with selection). The idea is to get all of the first type of non matching refs in a particular view (e.g. all the view refs for scope box 1 in a parent view).

And to finish it all off add a select in revit node. I normally keep this frozen by default until im actually using it.

Now heres where the magic happens. Set dynamo to auto and unfreeze the select in revit node and it will select the first set of a type of view refs (e.g. all scope box 1s) in a particular view. You can then set that to the correct target view in revit, and then dynamo automatically jumps to the next set. Once all the view refs for that view match, it will jump to the next set in the next view and you just keep going. You can see what the target view should be by looking at what type has been selected. Once all views are matching, it will stop selecting new elements, but it also helps to have a watch node to see how many aren’t matching.

It still sounds tedious but it saves a ton of time from no longer needing to open individual views and manually selecting refs.

Hopefully that has been articulated well enough. If that wasn’t clear, let me know and ill try to dig out a screenshot.