Home › Forums › Problems and solutions in GDL › Graphical UI and parameters list › Problem whith my program in interface page
Tagged: interface page
- This topic has 11 replies, 2 voices, and was last updated 9 years ago by antoine JULLIEN.
-
AuthorPosts
-
-
September 25, 2015 at 07:37 #1531antoine JULLIENParticipant
Hi, i want to list in interface page object some material parameters, but i want to mask on parameter if this one is not allow to changein my object (hide in box parameter or material = 1).
When i put if, it doesn’t work … why ?
dim Titre[4]
Titre[1] = “title1”
Titre[2] = “title2”
Titre[3] = “title3”
Titre[4] = “title4”dim Param[4]
Param[1] = “MaterialAttribute_1”
Param[2] = “MaterialAttribute_2”
Param[3] = “MaterialAttribute_3”
Param[4] = “MaterialAttribute_4”i=0
WHILE i <= 3 DO
i=i+1!if Param[i] > 1 then
UI_OUTFIELD Titre[i] ,15,i*25 ,120,20
UI_INFIELD Param[i] , 140,i*25,240,20
!ENDIFENDWHILE
Attachments:
Tonio
-
September 25, 2015 at 10:33 #1535Csilla MaiKeymaster
Hi Tonio,
On what kind of condition would you like to display the infield-outfield pairs?
Would you like to display the parameters on every condition, and instead lock the parameter which does not take effect? (As on the attached image)Attachments:
Csilla Mai
Library Developer, Library Team
GRAPHISOFT SE-
September 25, 2015 at 14:10 #1540antoine JULLIENParticipant
how i’ve you done it ? 🙂
Yes i would like to lock it or better I hope it does not appear and be replaced by the following – it’s in a macro apply on many product…
Tonio
-
September 25, 2015 at 14:25 #1541antoine JULLIENParticipant
I am checking if my Shader variable is equal to 1 or is hidden, if that’s the case I do not want to display it
Attachments:
Tonio
-
September 25, 2015 at 14:01 #1538antoine JULLIENParticipant
program update
dim Titre[5]
Titre[1] = “Tissu extérieur”
Titre[2] = “Tissu intérieur”
Titre[3] = “Accoudoir”
Titre[4] = “Passepoil”
Titre[5] = “Tissu Cale reins”dim Param[5]
Param[1] = “GerMaterial_1”
Param[2] = “GerMaterial_2”
Param[3] = “GerMaterial_3”
Param[4] = “GerMaterial_4”
Param[5] = “GerMaterial_5”i=0
WHILE i <= 4 DO
i=i+1if Param[i] = “1” THEN
hideparameter Param[i]
lock Param[i]ELSE
UI_OUTFIELD Titre[i] ,15,i*25 ,120,20
UI_INFIELD Param[i] , 140,i*25,240,20ENDIF
ENDWHILE
Tonio
-
September 25, 2015 at 14:07 #1539antoine JULLIENParticipant
Yes i would like to lock it or better I hope it does not appear and be replaced by the following – it’s in a macro apply on many product…
Tonio
-
-
September 25, 2015 at 15:46 #1543Csilla MaiKeymaster
Hi Tonio,
If the Surface parameters are handled as strings in an array, it is not possible to check their values. Neither is possible to check whether they are hidden in the caller object.
Instead I would recommend the following solution:
Create the Param and Titre arrays as a dynamic array parameter in the macro. Also all the string and material parameters you would like to handle in your macro.
When you call the macro from an object create the arrays in the User Interface script with the DIM command and fill them up with the surface parameters you would like to display. In the macro, loop through the array, until its dimension. The dimension should be given by the caller object.MACRO:
! Loop through the array until the actual array dimension given by the caller objectfor i = 1 to vardim1(Param) UI_OUTFIELD Titre[i], 15, i * 25, 120, 20 UI_INFIELD{4} Param[i], 140,i * 25, 240, 20 next i
CALLER OBJECT:
! Arrays in the caller object for the macro, filled with the parameters used by the caller object
! The actual dimension of these arrays is given by the caller object (below)dim Param[4] Param[1] = "MaterialAttribute_1" Param[2] = "MaterialAttribute_2" Param[3] = "MaterialAttribute_4" Param[4] = "MaterialAttribute_5" dim Titre[4] Titre[1] = title1 Titre[2] = title2 Titre[3] = title4 Titre[4] = title5 call "ui_surface_macro" parameters all Param = Param, Titre = Titre
Attachments:
Csilla Mai
Library Developer, Library Team
GRAPHISOFT SE-
September 26, 2015 at 07:11 #1547antoine JULLIENParticipant
Hi, I did not succeed with your sample, if i understand this solution force me to describe list material in all my objects ?
I want with my macro doing the list dynamicalyAttachments:
Tonio
-
September 26, 2015 at 07:45 #1549antoine JULLIENParticipant
my basic interface scrip work nice but is very long :
i=0
1:
IF GerMaterial_1 > 1 THEN
UI_OUTFIELD “Tissu Extérieur”,15, i ,200,20
UI_INFIELD “GerMaterial_1”, 140,i,240,20
else i=i
goto 22:
IF GerMaterial_2 > 1 THEN
UI_OUTFIELD “Tissu intérieur”,15,i+25 ,200,20
UI_INFIELD “GerMaterial_2”, 140,i+25,240,20
else i=i-25
goto 33:
IF GerMaterial_3 > 1 THEN
UI_OUTFIELD “Acoudoir”,15,i+50,200,20
UI_INFIELD “GerMaterial_3”, 140,i+50,240,20
else i=i-25
goto 44:
IF GerMaterial_4 > 1 THEN
UI_OUTFIELD “Passepoil”,15,i+75,200,20
UI_INFIELD “GerMaterial_4”, 140,i+75,240,20
else i=i-25
goto 55:
IF GerMaterial_5 > 1 THEN
UI_OUTFIELD “Tissu Cale reins”,15,i+100,200,20
UI_INFIELD “GerMaterial_5”, 140,i+100,240,20
else i=i-25
goto 66:
IF GerMaterial_6 > 1 THEN
UI_OUTFIELD “Tissu tétiere”,15,i+125,200,20
UI_INFIELD “GerMaterial_6”, 140,i+125,240,20
else i=i-25
goto 77:
IF GerMaterial_7 > 1 THEN
UI_OUTFIELD “Tissu assise”,15,i+150,200,20
UI_INFIELD “GerMaterial_7”, 140,i+150,240,20
else i=i-25
goto 88:
IF GerMaterial_8 > 1 THEN
UI_OUTFIELD “Bois horizontal”,15,i+175,200,20
UI_INFIELD “GerMaterial_8”, 140,i+175,240,20
else i=i-25
goto 99:
IF GerMaterial_9 > 1 THEN
UI_OUTFIELD “Bois vertical”,15,i+200,200,20
UI_INFIELD “GerMaterial_9”, 140,i+200,240,20
else i=i-25
goto 1010:
IF GerMaterial_10 > 1 THEN
UI_OUTFIELD “Métal”,15,i+225,200,20
UI_INFIELD “GerMaterial_10”, 140,i+225,240,20
else i=i-25
goto 1111:
IF GerMaterial_11 > 1 THEN
UI_OUTFIELD “Verre”,15,i+250,200,20
UI_INFIELD “GerMaterial_11”, 140,i+250,240,20
else i=i-25
goto 1212:
IF GerMaterial_11 > 1 THEN
UI_OUTFIELD “Plateau”,15,i+275,200,20
UI_INFIELD “GerMaterial_12”, 140,i+275,240,20
else i=i-25
goto 1313:
IF GerMaterial_13 > 1 THEN
UI_OUTFIELD “Pieds”,15,i+300,200,20
UI_INFIELD “GerMaterial_13”, 140,i+300,240,20
else i=i-25
goto 1414:
IF GerMaterial_14 > 1 THEN
UI_OUTFIELD “Tissus rideaux”,15,i+325,200,20
UI_INFIELD “GerMaterial_14”, 140,i+325,240,20
else i=i-25
goto 1515:
IF GerMaterial_15 > 1 THEN
UI_OUTFIELD “Boutons”,15,i+350,200,20
UI_INFIELD “GerMaterial_15”, 140,i+350,240,20ENDIF
Tonio
-
September 28, 2015 at 09:32 #1576Csilla MaiKeymaster
Hi Tonio,
You can display the parameters in the macro dynamically. I created three test objects with a macro based on your attached image, please check the zip file attached to this post.
Csilla Mai
Library Developer, Library Team
GRAPHISOFT SE -
September 30, 2015 at 16:39 #1599Csilla MaiKeymaster
Hi Tonio,
Apologies for the previous attachment (for version 20).
In this new attachment you can find two kinds of solutions in the Array_inCallerObject folder and Array_inMacro file. In the latter case you do not have to set the material list arrays in all of your objects, but the parameter would disappear if the user sets the Material parameter in the caller object to 1. Therefore the ‘All parameter’ list should not be hidden, because it could make the parameter invisible for the user, once its value is set to 1. The other solution would not hide the parameter from the user by setting its value to 1, but the materials have to be listed in the caller object.Attachments:
Csilla Mai
Library Developer, Library Team
GRAPHISOFT SE-
October 1, 2015 at 05:54 #1605antoine JULLIENParticipant
thank’s a lot, i’ll try your solution ! i need to install archicad 19 , i’m in 18 !
Tonio
-
-
AuthorPosts
- The forum ‘Graphical UI and parameters list’ is closed to new topics and replies.