コード例 #1
0
 public PipelineSpecifier(Resolve resolveDelegate, ContainerStore containerStore, ILogger logger)
 {
     this.SystemSpecs     = new List <SystemSpec>();
     this.ResolveDelegate = resolveDelegate;
     this.ContainerStore  = containerStore;
     this.Logger          = logger;
 }
コード例 #2
0
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            UIDocument uidoc = commandData.Application.ActiveUIDocument;
            Document   doc   = uidoc.Document;

            ContainerStore.Registration <MapStreamHttpService>();

            var osmServie = ContainerStore.Resolve <OsmService>();

            using (Transaction t = new Transaction(doc, "Build City"))
            {
                t.Start();

                // -73.8513, 40.6796, -73.8386, 40.6890
                // -74.0533, 40.6804, -73.9976, 40.7124
                // Define the map bounding box
                var mapbounds = new MapBounds
                {
                    Left   = -73.8513,
                    Bottom = 40.6796,
                    Right  = -73.8386,
                    Top    = 40.6890
                };

                OsmStore.Geolocate(mapbounds);
                osmServie.Run(doc);

                t.Commit();
            }


            return(Result.Succeeded);
        }
コード例 #3
0
        private static void GenerateRevitFile(DesignAutomationData daData)
        {
            var      rvtApp = daData.RevitApp;
            Document newDoc = rvtApp.NewProjectDocument(UnitSystem.Imperial) ?? throw new InvalidOperationException("Could not create new document.");

            var osmServie = ContainerStore.Resolve <OsmService>();

            using (Transaction t = new Transaction(newDoc, "Build City"))
            {
                t.Start();

                MapBounds mapBounds = MapBounds.Deserialize(File.ReadAllText(MapBoundsFile));
                OsmStore.Geolocate(mapBounds);
                osmServie.Run(newDoc);
                t.Commit();
            }

            newDoc.SaveAs(ResultFile);
        }
コード例 #4
0
        private List <OsmGeo> GetOsmGeoListFromMapStreamService(MapBounds mapbounds)
        {
            List <OsmGeo> list = new List <OsmGeo>();

            if (mapbounds.IsLarge(false))
            {
                var split = mapbounds.Split(false);
                list.AddRange(GetOsmGeoListFromMapStreamService(split[0]));
                list.AddRange(GetOsmGeoListFromMapStreamService(split[1]));
            }
            else if (mapbounds.IsLarge(true))
            {
                var split = mapbounds.Split(true);
                list.AddRange(GetOsmGeoListFromMapStreamService(split[0]));
                list.AddRange(GetOsmGeoListFromMapStreamService(split[1]));
            }
            else
            {
                var streamService = ContainerStore.Resolve <IMapStreamService>();
                return(streamService.GetOsmGeoList(mapbounds));
            }

            return(list.GroupBy(n => n.Id).Select(g => g.First()).ToList());
        }
コード例 #5
0
ファイル: ContainersWindow.cs プロジェクト: 0000duck/MiniRTS
 public ContainersWindow(ContainerStore containerStore, Tool toolSelector)
 {
     this.Containers   = containerStore.GetAllContainers().OrderBy(c => c.ComponentType.Name).ToList();
     this.ToolSelector = toolSelector;
 }
コード例 #6
0
 public PipelineBuilder(Resolve resolveDelegate, ContainerStore containerStore, ILogger logger)
 {
     this.ResolveDelegate = resolveDelegate;
     this.ContainerStore  = containerStore;
     this.Logger          = logger;
 }
コード例 #7
0
 public ExternalDBApplicationResult OnStartup(Autodesk.Revit.ApplicationServices.ControlledApplication app)
 {
     DesignAutomationBridge.DesignAutomationReadyEvent += HandleDesignAutomationReadyEvent;
     ContainerStore.Registration <MapStreamOnDemandService>();
     return(ExternalDBApplicationResult.Succeeded);
 }