mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
Added task to property / quanty relationship
This commit is contained in:
committed by
Dion Moult
parent
01c6a0d9be
commit
8396c68e75
@@ -415,18 +415,34 @@ void format_tasks(IfcSchema::IfcTask* task, ptree& node) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
IfcSchema::IfcPropertySetDefinition::list::ptr property_sets = get_related
|
||||||
|
<IfcSchema::IfcObject, IfcSchema::IfcRelDefinesByProperties, IfcSchema::IfcPropertySetDefinition>
|
||||||
|
(task, &IfcSchema::IfcObject::IsDefinedBy, &IfcSchema::IfcRelDefinesByProperties::RelatingPropertyDefinition);
|
||||||
|
|
||||||
|
for (IfcSchema::IfcPropertySetDefinition::list::it it = property_sets->begin(); it != property_sets->end(); ++it) {
|
||||||
|
IfcSchema::IfcPropertySetDefinition* pset = *it;
|
||||||
|
if (pset->declaration().is(IfcSchema::IfcPropertySet::Class())) {
|
||||||
|
format_entity_instance(pset, *ntask, true);
|
||||||
|
}
|
||||||
|
else if (pset->declaration().is(IfcSchema::IfcElementQuantity::Class())) {
|
||||||
|
format_entity_instance(pset, *ntask, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef SCHEMA_IfcProcess_HAS_OperatesOn
|
#ifdef SCHEMA_IfcProcess_HAS_OperatesOn
|
||||||
IfcSchema::IfcRelAssignsToProcess::list::ptr operates = task->OperatesOn();
|
IfcSchema::IfcRelAssignsToProcess::list::ptr operates = task->OperatesOn();
|
||||||
if (operates->size() > 0)
|
if (operates->size() > 0)
|
||||||
{
|
{
|
||||||
for (IfcSchema::IfcRelAssignsToProcess::list::it i = operates->begin(); i != operates->end(); ++i)
|
for (IfcSchema::IfcRelAssignsToProcess::list::it i = operates->begin(); i != operates->end(); ++i)
|
||||||
{
|
{
|
||||||
IfcSchema::IfcObjectDefinition::list::ptr objects = (*i)->RelatedObjects();
|
IfcSchema::IfcRelAssignsToProcess* operation = (*i);
|
||||||
|
IfcSchema::IfcObjectDefinition::list::ptr objects = operation->RelatedObjects();
|
||||||
for (IfcSchema::IfcObjectDefinition::list::it it2 = objects->begin(); it2 != objects->end(); ++it2)
|
for (IfcSchema::IfcObjectDefinition::list::it it2 = objects->begin(); it2 != objects->end(); ++it2)
|
||||||
{
|
{
|
||||||
IfcSchema::IfcObjectDefinition* object = (*it2);
|
IfcSchema::IfcObjectDefinition* object = (*it2);
|
||||||
ptree nobject;
|
ptree nobject;
|
||||||
nobject.put("<xmlattr>.id", object->GlobalId());
|
nobject.put("<xmlattr>.id", object->GlobalId());
|
||||||
|
nobject.put("<xmlattr>.Type", object->declaration().name());
|
||||||
ntask->add_child("OperatesOn", nobject);
|
ntask->add_child("OperatesOn", nobject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user