Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
How to read entity field value without knowing field name. Is there options to list down all fields in entity.
FilteredElementCollector collector = new FilteredElementCollector(doc);
collector.OfClass(typeof(DataStorage));
foreach (DataStorage dataStorage in collector)
{
IList<Guid> list = dataStorage.GetEntitySchemaGuids();
foreach (Guid guid in list)
{
Schema schema = Schema.Lookup(guid);
Entity entity = dataStorage.GetEntity(schema);
if (entity != null && entity.IsValid())
{
//read entity field
//string field_value = entity.Get<string>(field_name);
}
}
Solved! Go to Solution.