public void ValidIdentityInFederation() { using (var fedModel = XbimModel.CreateTemporaryModel()) { fedModel.Initialise("Federation Creating Author", "Federation Creating Organisation", "This Application", "This Developer", "v1.1"); using (var txn = fedModel.BeginTransaction()) { fedModel.IfcProject.Name = "Federation Project Name"; txn.Commit(); } //now add federated models fedModel.AddModelReference(ModelFedP1, "The Architects Name", IfcRole.Architect); fedModel.AddModelReference(ModelFedP2, "The Owners Name", IfcRole.BuildingOwner); fedModel.SaveAs("P1P2Federation", XbimStorageType.IFC); } //close and automatically delete the temporary database //Now open the Ifc file and see what we have using (var fed = new XbimModel()) { fed.CreateFrom("P1P2Federation.ifc", "P1P2Federation.xBIMF"); //use xBIMF to help us distinguish fed.Open("P1P2Federation.xBIMF", XbimExtensions.XbimDBAccess.Read); fed.EnsureUniqueUserDefinedId(); var mustDiffer = fed.Instances.OfType<IfcGeometricRepresentationSubContext>() .Where(x => x.ContextIdentifier == @"Body").ToArray(); // we are expecting two items (one body from each model loaded) // they happen to share the same entitylabel, but they have different models. var first = mustDiffer[0]; var second = mustDiffer[1]; Assert.IsFalse(first == second); var tst = new HashSet<IfcGeometricRepresentationContext>(); tst.Add(first); tst.Add(second); } }
public void ValidIdentityInFederation() { using (var fedModel = XbimModel.CreateTemporaryModel()) { fedModel.Initialise("Federation Creating Author", "Federation Creating Organisation", "This Application", "This Developer", "v1.1"); using (var txn = fedModel.BeginTransaction()) { fedModel.IfcProject.Name = "Federation Project Name"; txn.Commit(); } //now add federated models fedModel.AddModelReference(ModelFedP1, "The Architects Name", IfcRole.Architect); fedModel.AddModelReference(ModelFedP2, "The Owners Name", IfcRole.BuildingOwner); fedModel.SaveAs("P1P2Federation", XbimStorageType.IFC); } //close and automatically delete the temporary database //Now open the Ifc file and see what we have using (var fed = new XbimModel()) { fed.CreateFrom("P1P2Federation.ifc", "P1P2Federation.xBIMF"); //use xBIMF to help us distinguish fed.Open("P1P2Federation.xBIMF", XbimExtensions.XbimDBAccess.Read); fed.EnsureUniqueUserDefinedId(); var mustDiffer = fed.Instances.OfType <IfcGeometricRepresentationSubContext>() .Where(x => x.ContextIdentifier == @"Body").ToArray(); // we are expecting two items (one body from each model loaded) // they happen to share the same entitylabel, but they have different models. var first = mustDiffer[0]; var second = mustDiffer[1]; Assert.IsFalse(first == second); var tst = new HashSet <IfcGeometricRepresentationContext>(); tst.Add(first); tst.Add(second); } }