We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2021-05-15 02:12 PM - last edited on 2021-09-14 09:12 AM by Noemi Balogh
! "Steckdose_typ" is an array with values and descriptions rrr = request ("ASSOCLP_PARVALUE", "Steckdose_typ", Steckdose_typ) AC_MarkerText_5 = PARVALUE_DESCRIPTION ("Steckdose_typ") ! this didn't work AC_MarkerText_5 = str ("%.0", Steckdose_typ) !I got the value as numberQuestion 2:
text2 0.125,0,AC_MarkerText_5best regards,
2021-05-15 03:29 PM
ADD2 LABEL_POSITION[2][1]+LABEL_POSITION[3][1], LABEL_POSITION[3][2]
2021-05-15 04:06 PM
2021-05-15 04:41 PM
dim p_values_and_descriptions[] n = REQUEST ("ASSOCLP_PARVALUE_WITH_DESCRIPTION", "Steckdose_typ", name_or_index, type, flags, dim1, dim2, p_values_and_descriptions) for i = 1 to vardim1(p_values_and_descriptions) text2 0, i, p_values_and_descriptions next i
2021-05-16 09:41 AM
rrr = request ("ASSOCLP_PARVALUE", "Steckdose_typ", Steckdose_typ)
rrr = REQUEST ("ASSOCLP_PARVALUE", "Steckdose_typ", name_or_index, type, flags, dim1, dim2, Steckdose_typ)
2021-05-16 12:03 PM
! Step 1: Requesting the values of parameters in objects !-------------------------------------------------------- number_of_sockets = 1 ! Parameter 1 (Integer) n = request ("ASSOCLP_PARVALUE", "Steckdose_anzahl",name_or_index, type, flags, dim1, dim2, number_of_sockets) dim p_values_and_descriptions[] ! Parameter 2 (array) n = REQUEST ("ASSOCLP_PARVALUE_WITH_DESCRIPTION", "Steckdose_typ", name_or_index, type, flags, dim1, dim2, p_values_and_descriptions) ! Step 2: Inserting the values in textfields !------------------------------------------- font_size =1.5 font_size_m =font_size/1000*GLOB_SCALE ! font size in meters DEFINE STYLE "fontstyle_label" "Candela Book",font_size,4,0 SET STYLE "fontstyle_label" ADD2 LABEL_POSITION[2][1]+LABEL_POSITION[3][1], LABEL_POSITION[3][2] ! to move the Text to the origin of the Label offset_textbox = 0.075 ! offset between the text and the object ! Inserting the value of parameter 1 and only the description of parameter 2 for i = 2 to vardim1(p_values_and_descriptions) ! i=2 to skip the the value of parameter 2 in the array text2 offset_textbox,0,str ("%.0", number_of_sockets) + "X " + p_values_and_descriptions next i ! Inserting the elevation of the object as text text2 offset_textbox,-(font_size_m+0.005),"H:" + STR(GLOB_ELEVATION,5,2)+ "m" ! a fill to make the selection of the Label easier width_textbox = 0.5 add2 offset_textbox,font_size_m-0.02 fill "Nur Hintergrund-Stift" poly2_b{5} 5,2,1,3,195,0, 0,0,1,0,0,1,0, 0,0,33, 0,-font_size_m*3,33, width_textbox,-font_size_m*3,33, width_textbox,0,33, 0,0,33 ! drawing a line to the object line2 0,0,-0.1,0
2021-05-16 01:40 PM
2021-05-19 09:29 AM
Ah, of course, PARVALUE_DESCRIPTION ("parameter") is not working, because it's the wrong command. It simply does not exist in GDL.It does exist, you need to specify array indices when using it with an array.