Open deliciousteas opened 1 year ago
for (auto property : *RelProperty) {
// This is *not* the propery set yet, this is the relationship that ties property set to the element. So use RelatingPropertyDefinition to go the pset. This can be an IfcPropertySet or an IfcElementQuantity.
std::cout << property->RelatingPropertyDefinition()->data().toString() << std::endl;
}
::Ifc4::IfcRelDefinesByType::list::ptr typetest=master->IsTypedBy();
if (typetest && typetest->size()) {
// Properties can also be associated to the type, which unfortunately works differently.
auto psets = (*typetest->begin())->RelatingType()->HasPropertySets();
if (psets) {
for (auto& pset : *psets) {
std::cout << pset->data().toString() << std::endl;
}
}
}
It's amazing to hear back from you and your guidance helped me a lot in my research!!👍👍👍👍 In the next step, I will expand the code test for all attributes and some attributes extraction according to the research needs, of course, I will also test the differences between SPF and HDF5 formats.📄📄📄
@deliciousteas it's great that this is helping! Would you be interested in helping writing some beginner hello world style docs for C++? Our docs page are pretty lonely in the C++ portion :) https://blenderbim.org/docs-python/ifcopenshell.html
@Moult it's ok .Shall I contact you by email?
If you'd like dion@thinkmoult.com or you can just submit a PR directly here :)
I think i get trouble with utilizing ifcopenshell in c++. 🤔my goal is trying to get
ifcDuceSegment
all instance's property,especially about its size、length、area and so on. I have two ideas now, but I'm not sure which is appropriate.The first is to start with the IsDefinedBy method of the IfcDuctSegment, find the set of properties related to the IfcDuctSegment, and then query the instance properties according to the guid?
The second is to find ifc properties stored in quantity_set and property_set based on IFC documents, I have found classes such as IfcQuantityLength, but I don't know how to relate these properties to IfcDuctSegment instances?
I'm not sure if this idea is correct for IFC code and documentation, but welcome to talk!!_👂👂👂
Here is my code to get attribute from IfcDuctSegment: `IfcSchema::IfcQuantityLength::list::ptr length = file.instances_by_type();
IfcSchema::IfcElementQuantity::list::ptr elementquantity= file.instances_by_type();