We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2022-11-03 03:50 PM - last edited on 2024-09-26 12:12 PM by Doreena Deng
Hi all,
I tried to extract some element GUID via python using acc.GetElementsByType("Zone"), however the GUID generated I can't find any using find&select function within Archicad. May I know if the GUID obtained from the python script is shown somewhere in element information? Thanks.
2022-12-10 07:16 AM
I don't know if it is related, I am new to Archicad, but I also am observing properties' guid that aren't otherwise clear to me, their guid is nowhere to find.
I can fetch all properties:
allPropIDs = acc.GetAllPropertyIds() # 693 props
# [PropertyIdArrayItem {'propertyId': {'guid': '4A0D773E-33FB-4CF7-98FD-561044BCB21D'}}, ...
rooms = acc.GetElementsByType("Zone")
oneRoom = rooms[0]
props = acc.GetAllPropertyIdsOfElements([oneRoom]) # returns a list with 1 PropertyIdsOfElementWrapper
# [PropertyIdsOfElementWrapper {
# 'propertyIdsOfElement':
# {'elementId': {'guid': '4BFA60B2-5F49-416E-81D3-B02FA9C0BE41'},
# 'propertyIds': [{'propertyId': {'guid': '635169F9-62C9-4DD9-A64A-6E99128F1298'}}, {'propertyId': {'guid': '40D0D48E-5D5F-4E88-B44C-5EE49B21 ...
ids = props[0].propertyIdsOfElement.propertyIds # 414 props? Ehh?
# [PropertyIdArrayItem {'propertyId': {'guid': '635169F9-62C9-4DD9-A64A-6E99128F1298'}}, PropertyIdArrayItem {'propertyId': {'guid': '40D0D48E-5D5F-4E88-B44C-5EE49B21E78F'}}, ...
... and then fetch their details, I get a huge number of errors with a few valid entries:
dets = acc.GetDetailsOfProperties(ids) # list of PropertyDefinitionWrapper
# [ErrorItem {'error': {'code': 6702, 'message': 'Property definition not supported (property definition guid: "635169F9-62C9-4DD9-A64A-6E99128F1298")'}}, ErrorItem
print(dets)
here the output with more readability, two items as example. And BTW, is there somewhere a list of the error codes?
ErrorItem {'error': {'code': 6702, 'message': 'Property definition not supported (property definition guid: "8E3AFC90-5D05-4F80-B47B-A0862386F2A3")'}},
...
PropertyDefinitionWrapper {'propertyDefinition': {'group': {'propertyGroupId': {'guid': '1B193DB4-31FE-4DCA-93FF-3125D79B19C0'}, 'name': 'Raum'}, 'name': 'Berechnete Fläche (NRF)', 'description': '', 'isEditable': False, 'type': 'area', 'propertyId': {'guid': '9F8B3DFA-39D7-472D-A258-B988427C7EF9'}}},
....
And now I come to the point. If I then search for one of the error guid in the list obtained with acc.GetAllPropertyIds, I can't find this guid.
2022-12-12 03:57 AM
After several days I found out the real reason is the python script may not work correctly if another user(s) is using Archicad in the same machine, maybe all users share the same memory area.
2022-12-12 06:26 AM
In my case I am alone and using a demo version.
Still, I see tons of unclear property IDs that resolve to nothing (error).