public Result OnStartup(UIControlledApplication application) { var appPanel = application.CreateRibbonPanel(Tab.AddIns, "HLApps"); var showAppBtn = new PushButtonData("hleaPublishToGraph", "Publish to Graph", System.Reflection.Assembly.GetExecutingAssembly().Location, typeof(GraphAppShowCommand).FullName); showAppBtn.ToolTip = "Publish the current Revit model to a graph database"; appPanel.AddItem(showAppBtn); var syncBtn = new PushButtonData("hleaSyncWithGraph", "Pull Changes", System.Reflection.Assembly.GetExecutingAssembly().Location, typeof(RevitGraphSyncCommand).FullName); appPanel.AddItem(syncBtn); //TODO: persist settings with local storage SessionSettings = new RevitToGraphPublisherSettings(); RevitEventDispatcher.Init(); var streamConsumer = new RevitStreamConsumer(); var bc = new BuildingGraphClient(@"http://localhost:4002/graphql", null); var spacesEsh = new ElementStreamHandler(RevitEventDispatcher.Current, bc); streamConsumer.StreamHandlers.Add(spacesEsh); streamConsumer.Start(); return(Result.Succeeded); }
public GraphAppViewModel(RevitToGraphPublisher pubisher, GraphApp app) { _publishToGraphCommand = new Command(PublishToGraph); _cancelCommand = new Command(Close); _publisher = pubisher; _settings = app.SessionSettings; _app = app; }
public Result OnStartup(UIControlledApplication application) { var appPanel = application.CreateRibbonPanel(Tab.AddIns, "HLApps"); var showAppBtn = new PushButtonData("hleaPublishToGraph", "Publish to Graph", System.Reflection.Assembly.GetExecutingAssembly().Location, typeof(GraphAppShowCommand).FullName); showAppBtn.ToolTip = "Publish the current Revit model to a graph database"; appPanel.AddItem(showAppBtn); //TODO: persist settings with local storage SessionSettings = new RevitToGraphPublisherSettings(); return(Result.Succeeded); }