Transfer Project Standards

Ok, so here we go.

Based on the link I provided I am able to copy the “extents” of a linked view into the current model with the following graph.

I have done all the heavy lifting with python for each, but much of it may be able to be converted to nodes if you can find the right ones.

Also keep in mind that this graph is really proof of concept and is not production ready in any sense so don’t throw this at your real model right off the bat. Also, the view will come in with the same name as the one in the link so just make sure you don’t have the same view name already.

Get Linked Views:

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

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager

doc = DocumentManager.Instance.CurrentDBDocument

#Preparing input from dynamo to revit
link = UnwrapElement(IN[0])
vElems = []
names = []
cView = []

views = FilteredElementCollector(link).OfCategory(BuiltInCategory.OST_Views).WhereElementIsNotElementType().ToElements()

for view in views:
    name = []
    elems = FilteredElementCollector(link,view.Id).WhereElementIsNotElementType().ToElements()
    for e in elems:
        if e.Name == "ExtentElem":
            vElems.Add(e)
            break
    cView.Add(view)

OUT = vElems, cView

Copy:

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

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)

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

doc = DocumentManager.Instance.CurrentDBDocument

#Preparing input from dynamo to revit
link = UnwrapElement(IN[0])
elem = UnwrapElement(IN[1])
view = UnwrapElement(IN[2])

elemIds = []
elemIds.Add(elem.Id)

done = []
#Do some action in a Transaction
TransactionManager.Instance.EnsureInTransaction(doc)

views = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Views).WhereElementIsNotElementType().ToElements()
for v in views:
    if view.ViewType == ViewType.FloorPlan:
    tempView = v
    break

done.Add(ElementTransformUtils.CopyElements(view, List[ElementId](elemIds), tempView, Transform.Identity, CopyPasteOptions()))

TransactionManager.Instance.TransactionTaskDone()

OUT = done

Copy Link View.dyn (15.3 KB)

4 Likes