2021-10-17 03:01 PM - last edited on 2024-09-09 11:17 AM by Doreena Deng
Hello,
First of all, the new forum layout is terrible 🤢
Anyway, I'm having an issue with APPLICATION_QUERY() and I tried and tried solutions but to no avail so I come here for help. I have a MEP library part with two connections for water supply. I want to retrieve some info (pens, fills, surfaces) from the Systems list so I can have the piping coming out of it to look as it should.
As I do not know the index of the system, I need to retrieve it and then gets some of its info. Here's what I do :
DIM SYSTEM_2[][]
S1 = 0
S2 = 0
n1 = APPLICATION_QUERY ("MEPSYSTEM", "GetMEPSystems(2)", SYSTEM_2)
FOR i = 1 TO VARDIM2(SYSTEM_2)
IF SYSTEM_2[1][i] = ConSystem_1 THEN S1 = SYSTEM_2[1][i-1]
IF SYSTEM_2[1][i] = ConSystem_2 THEN S2 = SYSTEM_2[1][i-1]
NEXT i
n2 = APPLICATION_QUERY ("MEPSYSTEM", "GetSystemMaterial(S1)", MEPmaterial_1)
n3 = APPLICATION_QUERY ("MEPSYSTEM", "GetSystemMaterial(S2)", MEPmaterial_2)
(For this example, I do not check if the n are > 0)
So first query, I get all the piping systems ok. Second and third queries, I can't retrieve the SystemMaterial
For info, the GDL reference guide defines it that way : APPLICATION_QUERY (extension_name, parameter_string, variable1, variable2, ...) and it seems that I can't achieve what I want because the second argument of APPLICATION_QUERY() has to be a string so it is read literally and it cannot have a variable but then what's the point ? I can never know for sure the index of the System the user will be inputing so I cannot hardcode the index for GetSystemMaterial(). I tried to have the second argument without quotes but the whole query breaks then.
Any workaround ? It seems to be the only solution to retrieve this info 😭. Thanks.
Using AC24 on MacOS
Solved! Go to Solution.
2021-10-17 09:23 PM - edited 2021-10-17 09:25 PM
n2 = APPLICATION_QUERY ("MEPSYSTEM", "GetSystemMaterial(" + str("%.0", s1) + ")", MEPmaterial_1)
or
n2 = APPLICATION_QUERY ("MEPSYSTEM", "GetSystemMaterial(" + s1 + ")", MEPmaterial_1)
Structural engineer, developer of free addon for sync GDL param and properties
2021-10-17 09:23 PM - edited 2021-10-17 09:25 PM
n2 = APPLICATION_QUERY ("MEPSYSTEM", "GetSystemMaterial(" + str("%.0", s1) + ")", MEPmaterial_1)
or
n2 = APPLICATION_QUERY ("MEPSYSTEM", "GetSystemMaterial(" + s1 + ")", MEPmaterial_1)
Structural engineer, developer of free addon for sync GDL param and properties
2021-10-18 10:34 AM