Open thoffeller opened 5 years ago
There is a generic Add available. Generic get, too?
Ahh, ok, found somthing in the source in Document.cs : internal Dictionary<string, Ifc4.IfcPropertySetTemplate> IfcPropertySetTemplateCollection But it seems not to be avialable in nuget package.
Does that work?
foreach (var ifcPropertySetTemplate in document.IfcXmlDocument.Items.OfType<IfcPropertySetTemplate>())
{
foreach (IfcPropertyTemplate ifcPropertyTemplate in ifcPropertySetTemplate.HasPropertyTemplates.Items)
//do something
}
yes, implemented it already this way. But how should the method on top be used? or should it be removed?
I think, it should be removed. It is stuff that is more related to CAFM-Connect, than to standard IFC. Sort of helper classes.
You need the CcFacility class only when you want to write a CafmConnect file. In the first level an IfcSystem object must be created and the next levels are of type IfcObjectDefinition.
CcFacility groupFacility = document.Project.Facilities.AddNewSystem(document.Project);
groupFacility.IfcSystem.Name = "Group01";
CcFacility facility = groupFacility.Facilities.AddNewFacility();
// the default facility.IfcObjectDefinition is an IfcBuildingElementProxy object
// if you want to change this you can set the
facility.ObjectTypeId = /*e.g.*/ "i2139"; // or an Id from a IfcClassificationReference
This is a facility object you can pass to the GetIfcPropertySetTemplateCollection function. Or if you know the IfcPropertySetTemplate Id value.
var ifcPropertySetTemplate = document.IfcXmlDocument.Items.OfType<IfcPropertySetTemplate>().FirstOrDefault(item => item.Id == /*e.g.*/"i30425");
Hi, how do I retrieve the IfcPropertySetTemplate's from bim-profiles? In document.GetIfcPropertySetTemplateCollection(...) I need to provide a ccFacility, but the facilities collection of the doc is empty...
Is there a generic way to retrieve any object via its id? Thanks!