from Autodesk.Revit.DB import *
from pyrevit.forms import select_views
doc = __revit__.ActiveUIDocument.Document
uidoc = __revit__.ActiveUIDocument
app = __revit__.Application
wallsToCopy = FilteredElementCollector(doc)\
.OfCategory(BuiltInCategory.OST_Walls)\
.WhereElementIsNotElementType()\
.ToElementIds()
vector = XYZ(50, 50, 0)
t = Transaction(doc, __title__)
t.Start()
ElementTransformUtils.CopyElements(doc, wallsToCopy, vector)
t.Commit()
textToCopy = FilteredElementCollector(doc, doc.ActiveView.Id)\
.OfCategory(BuiltInCategory.OST_TextNotes)\
.WhereElementIsNotElementType()\
.ToElementIds()
src_view = doc.ActiveView
dest_view = select_views(__title__,multiple=False)
transform = Transform.Identity
opts = CopyPasteOptions()
t = Transaction(doc, __title__)
t.Start()
ElementTransformUtils.CopyElements(src_view, textToCopy, dest_view, transform, opts)
t.Commit()
wallsToCopy = FilteredElementCollector(doc)\
.OfCategory(BuiltInCategory.OST_Walls)\
.WhereElementIsNotElementType()\
.ToElementIds()
all_docs = list(app.Documents)
doc_A = all_docs[0]
doc_B = all_docs[1]
transform = Transform.Identity
opts = CopyPasteOptions()
t = Transaction(doc_B, __title__)
t.Start()
ElementTransformUtils.CopyElements(doc_A, wallsToCopy, doc_B, transform, opts)
t.Commit()