Exemplo n.º 1
0
def get_dest_docs():
    # find open documents other than the active doc
    selected_dest_docs = \
        forms.select_open_docs(title='Select Destination Documents')
    if not selected_dest_docs:
        sys.exit(0)
    else:
        return selected_dest_docs
Exemplo n.º 2
0
def get_dest_docs():
    # find open documents other than the active doc
    selected_dest_docs = \
        forms.select_open_docs(title='Select Destination Documents',
                               filterfunc=lambda d: not d.IsFamilyDocument)
    if not selected_dest_docs:
        sys.exit(0)
    else:
        return selected_dest_docs
Exemplo n.º 3
0
__helpurl__ = '{{docpath}}ThzcRM_Tj8g'
__doc__ = 'Converts selected legend views to detail views and copies '\
          'them to all projects currently open in Revit.'


logger = script.get_logger()


class CopyUseDestination(DB.IDuplicateTypeNamesHandler):
    def OnDuplicateTypeNamesFound(self, args):
        return DB.DuplicateTypeAction.UseDestinationTypes


# find open documents other than the active doc
open_docs = forms.select_open_docs(title='Select Destination Documents')
if not open_docs:
    sys.exit(0)

# get a list of selected legends
legends = forms.select_views(
    title='Select Drafting Views',
    filterfunc=lambda x: x.ViewType == DB.ViewType.Legend)

if legends:
    for dest_doc in open_docs:
        # get all views and collect names
        all_graphviews = revit.query.get_all_views(doc=dest_doc)
        all_drafting_names = [x.ViewName
                              for x in all_graphviews
                              if x.ViewType == DB.ViewType.DraftingView]
Exemplo n.º 4
0
# Import Revit DB
from Autodesk.Revit.DB import FilteredElementCollector, ElementTransformUtils, BuiltInCategory, \
                            ElementId, Transform, CopyPasteOptions, Transaction, TransactionGroup, ElementCategoryFilter

# Import pyRevit forms
from pyrevit import forms

# Store current document to variable
app = __revit__.Application
doc = __revit__.ActiveUIDocument.Document
uidoc = __revit__.ActiveUIDocument

# Select opened documents to transfer View Templates
selProject = forms.select_open_docs(
    title="Select project/s to transfer View Templates",
    button_name='OK',
    width=500,
    multiple=True,
    filterfunc=None)

# Filter Views
viewsFilter = ElementCategoryFilter(BuiltInCategory.OST_Views)


# Function to retrieve View Templates
def retrieveVT(docList, currentDoc):
    storeDict = {}
    if isinstance(docList, list):
        for pro in docList:
            viewsCollector = FilteredElementCollector(pro).WherePasses(
                viewsFilter)
            for view in viewsCollector:
Exemplo n.º 5
0
            # close window and submit print
            self.Close()
            if self.combine_print:
                self._print_combined_sheets_in_order(target_sheets)
            else:
                if self.selected_doc.IsLinked:
                    self._print_linked_sheets_in_order(target_sheets)
                else:
                    self._print_sheets_in_order(target_sheets)
            self._reset_psettings()


def cleanup_sheetnumbers(doc):
    sheets = revit.query.get_sheets(doc=doc)
    with revit.Transaction('Cleanup Sheet Numbers', doc=doc):
        for sheet in sheets:
            sheet.SheetNumber = sheet.SheetNumber.replace(NPC, '')


# verify model is printable
forms.check_modeldoc(exitscript=True)

# TODO: add copy filenames to sheet list
if __shiftclick__:  #pylint: disable=E0602
    open_docs = forms.select_open_docs(check_more_than_one=False)
    if open_docs:
        for open_doc in open_docs:
            cleanup_sheetnumbers(open_doc)
else:
    PrintSheetsWindow('PrintSheets.xaml').ShowDialog()
Exemplo n.º 6
0
            # close window and submit print
            self.Close()
            if self.combine_print:
                self._print_combined_sheets_in_order(target_sheets)
            else:
                if self.selected_doc.IsLinked:
                    self._print_linked_sheets_in_order(target_sheets)
                else:
                    self._print_sheets_in_order(target_sheets)
            self._reset_psettings()


def cleanup_sheetnumbers(doc):
    sheets = revit.query.get_sheets(doc=doc)
    with revit.Transaction('Cleanup Sheet Numbers', doc=doc):
        for sheet in sheets:
            sheet.SheetNumber = sheet.SheetNumber.replace(NPC, '')


# verify model is printable
forms.check_modeldoc(exitscript=True)

# TODO: add copy filenames to sheet list
if __shiftclick__:  #pylint: disable=E0602
    open_docs = forms.select_open_docs()
    if open_docs:
        for open_doc in open_docs:
            cleanup_sheetnumbers(open_doc)
else:
    PrintSheetsWindow('PrintSheets.xaml').ShowDialog()