2018-12-1109:51 AM - last edited on 2022-10-0404:52 PM by Daniel Kassai
Hello Archicad community,
Based on the grid mesh I can get each facade panel's dimensions and convert it into a wall (attachment 1 is the input, attachment 2 the output), however, the panels I get do not seem to be in any particular order (attachment 2). If I loop over the panels I get from "memo.cWallPanels" (API_CWPanelType) and build a wall based on the panel's material (glass or opaque) the order is not the same (and there also does not seem to be any other order which I could correlate).
Is there any way I could retrieve the panels in such a way that I know their position in the grid mesh and assign the correct material accordingly?
In theory it's possible to get the panels in order, but unfortunately two bugs in the API prevent us to do that:
cWallPanelGridIDTable member of the API_ElementMemo is always nullptr. That member should contain the information about the positions of the panels in the grid.
API_CWPanelType structure does not contain the ID of the segment, so if the curtain wall has multiple segments then the panels cannot be sorted correctly (because each segment has individual grid and a gridCellID is not unique).
I added these bugs to our bug database.
The first will be fixed in an upcoming update for AC22 (buildnum higher than 5500).
The second one needs API interface modification: the filler_1 member of the API_CWPanelType structure will be reused, that will contain the index of the segment which contains the panel. I hope that modification can be done also in an upcoming update for AC22 (buildnum higher than 5500).
I will notify again you when the modifications were successfully done. After that you can use the following code to get the sorted panels:
Interesting... I already stumbled upon cWallPanelGridIDTable in the code, but could not click on it in the docs and so didn't know how to use it - I guess this is related to the nullptr issue you mentioned.
Thanks a lot for the code already, it will be very useful as soon as I can use it