MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / set

Function set

src/ifcconvert/IfcConvert.cpp:1512–1522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1510
1511 template <typename T>
1512 void set(IfcUtil::IfcBaseClass* inst, const std::string& attr, T t) {
1513 auto decl = inst->declaration().as_entity();
1514 auto i = decl->attribute_index(attr);
1515
1516 auto attr_type = decl->attribute_by_index(i)->type_of_attribute();
1517 if (attr_type->as_named_type() && attr_type->as_named_type()->declared_type()->as_enumeration_type() && !std::is_same<T, EnumerationReference>::value) {
1518 set_enumeration(inst, attr, attr_type->as_named_type()->declared_type()->as_enumeration_type(), t);
1519 } else {
1520 inst->set_attribute_value(i, t);
1521 }
1522 }
1523
1524 IfcUtil::IfcBaseClass* create(IfcParse::IfcFile& f, const std::string& entity) {
1525 auto decl = f.schema()->declaration_by_name(entity);

Callers 15

set_enumerationFunction · 0.70
createFunction · 0.70
fix_quantitiesFunction · 0.70
build-all.pyFile · 0.50
ensure_hirarchyMethod · 0.50
SvIfcStoreClass · 0.50
purgeMethod · 0.50
editMethod · 0.50
step_implFunction · 0.50
step_implFunction · 0.50

Calls 2

set_enumerationFunction · 0.85
set_attribute_valueMethod · 0.80