Copy sheets and floor plan views that exist in a linked model

Great tools here! Just getting started with it and on the brink of trying to do some self-taught learning of Python (wish me luck!). Looking to hopefully some day create my own tools for MEP type workflows!

Can the pyRevit command for “Copy Sheets to Open Documents” be recreated in any manner such that:

  1. sheets can be copied from a linked document instead of just an open document
  2. the plan view(s) and their specific locations on the sheets copied in addition to other view types

I’ve posted on this topic in the Dynamo Forum previously, and thought this might be a different group of people who may be able to help figure out the issue…

Thanks in advance!

I’m sure you know that ‘model’ views, even if the are recreated in a another Revit model, would only show the contents of the actual 3d model. So copying a plan view would only bring the view definition and not the content. Copying such views is actually not possible in Revit API, so the tool must read all the properties of the original view, and recreate the same views in the target model. This, is also quite limited in the API

Thank you for the response @eirannejad!

Sounds exactly like what I’d like to see accomplished!
With my limited knowledge though, it sounds pretty in-depth and difficult, but not impossible…would you agree?

I compare what I’m trying to do here to the way an MEP project would have been set up in AutoCAD, prior to the days of Revit. Essentially, the architects would have created the sheets with overall plan views and additional sheets with enlarged views on them. An MEP engineer would generally copy the architects sheets, along with the reference files (Xref). All of the annotations in the views would then be deleted, allowing just the Xref to remain as the starting backgrounds for the MEP designs.

This will allow an MEP consultants set of drawings to have floor plans that are cropped the same and align with the architects plan locations on the sheets, thus creating a seemingly better coordinated (non-technical of course) drawing set.

So I guess, trying to understand your workflows better, and knowing that you can ‘reference’ a Revit view from an architect’s linked model in your Revit views: wouldn’t it be a better approach to directly reference views instead of recreating them in your models?

@eirannejad, agree, maybe I need to better explain my workflow more. Thanks for the conversation though, I really appreciate it!

I’m looking to essentially recreate any given sheet in an architectural model and make it a “template” sheet in my supporting MEP model. This way I can use the template sheet to align the plan views across all disciplines throughout the MEP model.

To possibly simplify things at the moment, the current architecture firm we do work with uses scope boxes. However, it’s possible that work with future additional architecture firms may not (I realize this may complicate the workflow significantly).

Is this easier to understand?

Hi,
From a different angle I would either:

  • Take a tool like RushForth tools project setup, cheap and very efficient to manage sheets and views across projects and models (all is manageable through a excel sheet like system)
  • Use a mix of diRoots tools that helps you manage sheets and views.
  • Or use the architect’s model, wipe everything uneeded and transfer project standards with builtin tool in revit or using joTools transfer single to be more precise
1 Like

Wow, apparently lots more tools out there I need to familiarize myself with! Thanks @Jean-Marc!

2 Likes

Is there a way to copy the section view symbol from linked file? or is there a workaround to create a section line in the host model in the same position of linked model section view?

I wrote that script to try to solve my question

# -*- coding: utf-8 -*-

import clr

# Aggiungi il riferimento alle librerie di Revit API
clr.AddReference('RevitAPI')
clr.AddReference('RevitAPIUI')

from Autodesk.Revit.DB import FilteredElementCollector, RevitLinkInstance, ViewSection, Transaction, ElementId, ViewType
from Autodesk.Revit.UI import TaskDialog

# Ottieni l'accesso all'interfaccia utente e al documento corrente
uidoc = __revit__.ActiveUIDocument
doc = uidoc.Document

# Funzione per elencare i modelli linkati
def list_linked_models(doc):
    linked_models = {}
    collector = FilteredElementCollector(doc).OfClass(RevitLinkInstance)
    for item in collector:
        linked_models[item.Name] = item.GetLinkDocument()
    return linked_models

# Funzione per elencare le viste di sezione in un modello linkato
def list_section_views(linked_doc):
    section_views = {}
    collector = FilteredElementCollector(linked_doc).OfClass(ViewSection)
    for view in collector:
        if not view.IsTemplate:
            section_views[view.Name] = view
    return section_views

# Funzione per copiare le viste di sezione selezionate per nome
def copy_section_views_by_name(source_views, target_doc, view_names):
    with Transaction(target_doc, "Copy Section Views") as trans:
        trans.Start()
        try:
            for view_name in view_names:
                source_view = next((v for v in source_views if v.Name == view_name), None)
                if source_view and source_view.ViewType == ViewType.Section:
                    source_box = source_view.CropBox
                    new_view = ViewSection.CreateSection(target_doc, source_view.GetTypeId(), source_box)
                    # Copia ulteriori impostazioni della vista qui
            trans.Commit()
        except Exception as e:
            trans.RollBack()
            raise

# Elenco dei modelli linkati
linked_models = list_linked_models(doc)

# Presenta all'utente un elenco di modelli linkati e permette di scegliere
print("Modelli linkati disponibili:")
for i, model_name in enumerate(linked_models.keys(), start=1):
    print("%d. %s" % (i, model_name))

try:
    selected_index = int(raw_input("Seleziona il numero del modello linkato: ")) - 1
    selected_model_name = list(linked_models.keys())[selected_index]
    selected_model_doc = linked_models[selected_model_name]

    # Verifica se il modello è stato trovato
    if selected_model_doc:
        # Elenco delle viste di sezione nel modello linkato
        section_views = list_section_views(selected_model_doc)
        print("Viste di sezione disponibili:")
        for view_name in section_views.keys():
            print(view_name)

        # Chiedi all'utente di selezionare le viste da copiare
        selected_views_input = raw_input("Inserisci i nomi delle viste da copiare, separati da virgola: ")
        selected_view_names = [name.strip() for name in selected_views_input.split(',')]

        if selected_view_names:
            copy_section_views_by_name(section_views.values(), doc, selected_view_names)
            TaskDialog.Show("Successo", "Viste copiate con successo.")
        else:
            TaskDialog.Show("Errore", "Nessun nome di vista valido inserito.")
    else:
        TaskDialog.Show("Errore", "Modello linkato non trovato.")
except Exception as e:
    TaskDialog.Show("Errore", str(e))

It open an UI where I am able to select the linked project, select the name of views section to copy and at the end it gives me the message “Views are copied successfully”, but in real there are not new views in my host project.