Nutzen Sie den Attributwert für ein IFC -Modellelement mit C#
Posted: 09 Apr 2025, 22:19
Ich arbeite derzeit daran, den Wert des Attributs mit dem Namen ifcClass innerhalb der Registerkarte "Element" für ein bestimmtes Modellelement mit C# Code abzurufen. Ich frage mich, ob es eine andere Möglichkeit gibt, diese Eigenschaften zu bekommen. < /P>
Eine Anleitung zum Zugriff auf diese würde sehr geschätzt!>
Code: Select all
ifcModel = IfcStore.Open(ifcFilePath);
List moddValidation = new List();
List mODDItems = new List();
string ifcClass = null;
List ifcProducts = new List();
foreach (var instance in ifcModel.Instances)
{
if (instance is IIfcProduct ifcProduct && ifcProduct.Representation != null)
{
ifcProducts.Add(ifcProduct);
}
}
foreach (IIfcProduct ifcProxy in ifcModel.Instances.OfType().Where(l => l.Representation != null).ToList())
{
IIfcElement ifcElement = ifcModel.Instances.FirstOrDefault(m => m.GlobalId == ifcProxy.GlobalId);
if (ifcProxy.Representation != null && ifcElement != null)
{
countItems++;
List propSets = ifcElement.IsDefinedBy.Where(k => (k.RelatingPropertyDefinition is IIfcPropertySet)).SelectMany(j => j.RelatingPropertyDefinition.PropertySetDefinitions).OfType().ToList();
}
}