// POST: api/BIMModel
        public void Post([FromBody] BIMModel value)
        {
            WebApiApplication.Projects[value.ProjectId].BIMModel = value;

            value.SVFUrn64 = GetForgeInfo.GetURN64(value.SVFUrn).Replace("=", "");
            value.FBXUrn64 = GetForgeInfo.GetURN64(value.FBXUrn).Replace("=", "");
            //if (value.SVFUrn == null) value.SVFUrn = "前端没有SVFUrn";
            //if (value.SourceName == null) value.SourceName = "前端没有SourceName";
        }
Beispiel #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            Projects = new List <Project>()
            {
                MakeAProjectByMyself()
            };
            GetForgeInfo.Initialization();
            //监视模型们的progress
            //var t = new Thread(() =>
            //  {
            //      while (true)
            //      {
            //          Thread.Sleep(5000);
            //          foreach (var proj in Projects)
            //          {
            //              if (proj.BIMModel.Status == BIMModel.BIMMStatus.转换中)
            //                  UpdateBIMModelProgress(proj.BIMModel);
            //              foreach(var rcmodel in proj.UsedRCModel)
            //              {
            //                if(rcmodel.Status == RCModel.RCMStatus.转换中)
            //                  {
            //                      UpdateRCModelProgress(rcmodel);
            //                  }
            //              }
            //          }
            //      }
            //  });

            //监视result文件夹
            var t2 = new Thread(() =>
            {
                while (true)
                {
                    foreach (var file in Directory.GetFiles(resultPath))
                    {
                        //if (file.Contains("start")) ;

                        if (file.Contains("end"))
                        {
                            File.AppendAllText(resultPath + "Ht.txt", "sdasfdsaf");
                        }
                    }
                    Thread.Sleep(5000);
                }
            });
        }
Beispiel #3
0
        private async void UpdateBIMModelProgress(BIMModel bimModel)
        {
            await Task.Run(() =>
            {
                //费时间的操作
                string progress = GetForgeInfo.GetProgress(GetForgeInfo.client, GetForgeInfo.token, bimModel.SVFUrn);
                if (progress == "complete")
                {
                    GetForgeInfo.DownloadFile(@"C:\Users\Laugh\Desktop\天线宝宝队\Server\fbx\", GetForgeInfo.client, GetForgeInfo.token, bimModel.FBXUrn);

                    bimModel.Status = BIMModel.BIMMStatus.已完成;
                }
            });
        }
 public string GetString()
 {
     return(GetForgeInfo.DownloadFile(@"C:\Users\Laugh\Desktop\天线宝宝队\", GetForgeInfo.client, GetForgeInfo.token, "urn:adsk.viewing:fs.file:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6ZjE0OGM5YTEzYmFlNGU2Zjk0NDdjZGU5ZTdjNTBkZTUvJUU5JUExJUI5JUU3JTlCJUFFMS0lRTQlQjglODklRTclQkIlQjQlRTglQTclODYlRTUlOUIlQkUtJTdCM0QlN0QuZmJ4/output/1/项目1-三维视图-{3D}.svf"));
 }