[英]How to get GUIDs of COM classes from the interface names used in the Windows API documentation?
[英]Get the GUIDs contained in an IFCGROUP
如何使用 IfcOpenShell 獲取 IFCGROUP 中包含的 GUID?
在此示例中,我在 IFCGroup 中有兩個 GUID IFCWall
IFCGROUP GUI: 0MP5lKfsX6pBH1cXwBPLF0
IFCWALLSTANDARDCASE GUI: 0MP5lKfsX6pBH1cXwBPLEX
IFCWALLSTANDARDCASE GUI: 0MP5lKfsX6pBH1cXwBPLEA
我需要一個 function 來返回這個:
res = getElements('0MP5lKfsX6pBH1cXwBPLF0')
print(res) // [0MP5lKfsX6pBH1cXwBPLEX, 0MP5lKfsX6pBH1cXwBPLEA]
關鍵是理解逆屬性( IsGroupedBy
)和對象化關系( http://ifc43-docs.standards.buildingsmart.org/IFC/RELEASE/IFC4x3/HTML/lexical/IfcRelAssignsToGroup.htm )
import operator
import ifcopenshell
ifc_file = ifcopenshell.open(...)
group = ifc_file['0MP5lKfsX6pBH1cXwBPLF0']
if group.IsGroupedBy:
result = list(map(operator.attrgetter('GlobalId'), group.IsGroupedBy[0].RelatedObjects))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.