mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
[ifcConvert] Add related objects in tasks
This commit is contained in:
committed by
Dion Moult
parent
a4366ef151
commit
f089d03dc6
@@ -407,6 +407,27 @@ void format_tasks(IfcSchema::IfcTask* task, ptree& node) {
|
||||
format_tasks(task2, *ntask);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef SCHEMA_IfcProcess_HAS_OperatesOn
|
||||
auto operates = task->OperatesOn();
|
||||
if (operates->size() > 0)
|
||||
{
|
||||
ptree noperates_on;
|
||||
for (auto i = operates->begin(); i != operates->end(); ++i)
|
||||
{
|
||||
auto objects = (*i)->RelatedObjects();
|
||||
for (auto it2 = objects->begin(); it2 != objects->end(); ++it2)
|
||||
{
|
||||
auto object = (*it2);
|
||||
ptree nobject;
|
||||
nobject.put("<xmlattr>.id", object->GlobalId());
|
||||
noperates_on.add_child("Object", nobject);
|
||||
}
|
||||
}
|
||||
|
||||
ntask->add_child("OperatesOn", noperates_on);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user