// Extract from returned json the project info internal string SetProjectStructure(ForgeRestResponse ret, string parentId) { NLogger.LogText("Entered SetProjectStructure"); string projectId = ""; JObject res = JObject.Parse(ret.ResponseContent); var data = res.SelectTokens("$.data").Children(); foreach (var item in data) { var name = ((string)item.SelectToken("attributes.name")); if (name == ConfigUtilities.GetProject()) { projectId = (string)item.SelectToken("id"); //bIM360DocsStructure.Hub.ProjectList = new List<Project> { new Project { Id = projectId, Name = name } }; bIM360DocsStructure1.BIM360DataRows1.Add(new BIM360DocsRowStructure { ParentId = parentId, Id = projectId, Name = name, Type = BIM360Type.Project }); } } NLogger.LogText("Exit SetProjectStructure"); return(projectId); }
/// <summary> /// Returns the BIM360 configured Project folder /// </summary> /// <returns></returns> public static string GetProjectFolder() { return(Utility.GetBIM360RootPath() + ConfigUtilities.GetHub() + "\\" + ConfigUtilities.GetProject() + "\\"); }