public void QueryingNestedPropFunction() { // DirectoryInfo d = new DirectoryInfo("."); // to find folder location XbimModel model = new XbimModel(); model.Open(SourceModelFileName, XbimDBAccess.Read); var chkCnt = model.Query("select @12275.Representation.Representations"); Assert.AreEqual(3, ((IEnumerable<object>)chkCnt).Count()); model.Close(); }
public void QueryingSelectAllModel() { // DirectoryInfo d = new DirectoryInfo("."); // to find folder location using (XbimModel model = new XbimModel()) { model.Open(SourceModelFileName, XbimDBAccess.Read); var cnt = model.Query(@"select @*"); Assert.IsNotNull(cnt); dynamic doors = model.Query(@"select @IfcDoor.Where(@OverallHeight==2090)"); Assert.IsNotNull(doors); Assert.AreEqual(36, doors.Count); doors = model.Query(@"select @IfcDoor.Where(@OverallHeight==2090 && @OverallWidth==790)"); Assert.IsNotNull(doors); Assert.AreEqual(4, doors.Count); model.Close(); } }
public void ModelRootBasicQuery() { // DirectoryInfo d = new DirectoryInfo("."); // to find folder location XbimModel model = new XbimModel(); model.Open(SourceModelFileName, XbimDBAccess.Read); var cnt = model.Instances.OfType("IfcWall", false).Count(); var chkCnt = model.Query("select @ifcWall"); var c2 = chkCnt as IEnumerable<IPersistIfcEntity>; int cnt2 = c2.Count(); Assert.AreEqual(cnt, cnt2); model.Close(); }
public void QueryingSelectFunction() { // DirectoryInfo d = new DirectoryInfo("."); // to find folder location XbimModel model = new XbimModel(); model.Open(SourceModelFileName, XbimDBAccess.Read); var cnt = model.Instances.OfType("IfcWall", false).Count(); var chkCnt = model.Query("select @ifcWall.Count()"); Assert.AreEqual(cnt.ToString(), chkCnt.ToString()); model.Close(); }
public void QueryingSelectContextualWhere() { // DirectoryInfo d = new DirectoryInfo("."); // to find folder location using (XbimModel model = new XbimModel()) { model.Open(SourceModelFileName, XbimDBAccess.Read); var cnt = model.Query(@"select @12275.Representation.Representations.Where(@RepresentationIdentifier==""Body"")") as List<Object>; Assert.IsNotNull(cnt); Assert.AreEqual(1, cnt.Count()); model.Close(); } }
public void QueryingSelectWhere() { // DirectoryInfo d = new DirectoryInfo("."); // to find folder location using (XbimModel model = new XbimModel()) { model.Open(SourceModelFileName, XbimDBAccess.Read); var cnt = model.Query("select @12275.Representation.Representations.Where(true)") as List<Object>; Assert.IsNotNull(cnt); Assert.AreEqual(3, cnt.Count()); cnt = model.Query("select @12275.Representation.Representations.Where(false)") as List<Object>; Assert.IsNotNull(cnt); Assert.AreEqual(0, cnt.Count()); cnt = model.Query("select @12275.Representation.Representations.Where(1<2)") as List<Object>; Assert.IsNotNull(cnt); Assert.AreEqual(3, cnt.Count()); model.Close(); } }
public void QueryingSelectProp() { // DirectoryInfo d = new DirectoryInfo("."); // to find folder location using (XbimModel model = new XbimModel()) { model.Open(SourceModelFileName, XbimDBAccess.Read); var chkCnt = model.Query("select @12275.Representation"); Assert.IsInstanceOfType(chkCnt, typeof(IfcProductDefinitionShape)); model.Close(); } }
public void QueryingSelectNestedPropRange() { // DirectoryInfo d = new DirectoryInfo("."); // to find folder location using (XbimModel model = new XbimModel()) { model.Open(SourceModelFileName, XbimDBAccess.Read); var cnt = model.Query("select @12275.Representation.Representations.Range(1,1)") as List<Object>; IPersistIfcEntity ent = cnt.FirstOrDefault() as IPersistIfcEntity; Assert.AreEqual(12266, Math.Abs(ent.EntityLabel)); model.Close(); } }