def __init__(self,
                 __revit__,
                 search_id=None,
                 excel_parameters=None,
                 xl_file_path=None,
                 xl_write_flag=False):
        # region Get Document and Application
        self.doc = __revit__.ActiveUIDocument.Document
        self.uidoc = UIDocument(self.doc)
        self.app = __revit__.Application
        self.uiapp = UIApplication(self.app)
        self.excel = Excel.ApplicationClass()
        System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo(
            "en-US")
        # endregion

        # region Initial parameters
        self._search_id = search_id
        self._excel_parameters = excel_parameters
        self._xl_file_path = xl_file_path
        self._xl_write_flag = xl_write_flag
        self.New_MEPSpaces = {}
        self.Exist_MEPSpaces = {}

        # Create a space collector instance
        self._space_collector = FilteredElementCollector(
            self.doc).WhereElementIsNotElementType().OfCategory(
                BuiltInCategory.OST_MEPSpaces)

        # endregion

        # region Custom Events
        self.startProgress = Event()
        self.ReportProgress = Event()
        self.endProgress = Event()
Beispiel #2
0
def sendKey(sender, args):
    global elements
    if script.get_envvar(SYNC_VIEW_ENV_VAR):
        event_doc = sender.ActiveUIDocument.Document
        uiapp = UIApplication(event_doc.Application)
        while True:
            if len(get_selected_elements(event_doc)) == 1:
                time.sleep(1)
                # TaskDialog.Show("Count Total", str(len(elements)))
                #TaskDialog.Show("Count Current", str(len(get_selected_elements(doc))))
                #time.sleep(1)
                # SendKeys.SendWait("+{K}")

                break
            else:
                return
        # TaskDialog.Show("Count 1", str(len(elements)))

        revit.get_selection().set_to(elements[1:])
Beispiel #3
0
    OpenOptions,WorksetConfiguration, WorksetConfigurationOption, DetachFromCentralOption,\
    ModelPathUtils, SaveAsOptions, WorksharingSaveAsOptions
import re
from Autodesk.Revit.DB import Level, BuiltInParameter
from Autodesk.Revit.UI import TaskDialog, UIApplication
clr.AddReferenceByPartialName('PresentationCore')
clr.AddReferenceByPartialName('PresentationFramework')
clr.AddReferenceByPartialName('System.Windows.Forms')
clr.AddReferenceByPartialName('System')
import System
from System import Guid
import System.Windows.Forms
uidoc = __revit__.ActiveUIDocument
doc = __revit__.ActiveUIDocument.Document
from pyrevit.framework import List
from pyrevit import revit, DB
import os
from collections import defaultdict
from pyrevit import script
from pyrevit import forms
from Autodesk.Revit.UI.Events import DialogBoxShowingEventArgs

uiapp = UIApplication(doc.Application)
application = uiapp.Application
__doc__ = 'Print Model GUID and Project GUID'

ModelGUID = doc.GetCloudModelPath().GetModelGUID()
ProjectGUID = doc.GetCloudModelPath().GetProjectGUID()
print("Model GUID: " + str(ModelGUID))
print("Project GUID: " + str(ProjectGUID))