Problem whith my program in interface page

Home Forums Problems and solutions in GDL Graphical UI and parameters list Problem whith my program in interface page

This topic contains 11 replies, has 2 voices, and was last updated by  antoine JULLIEN 1 year, 11 months ago.

  • Author
    Posts
  • #1531

    antoine JULLIEN
    Participant

    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 > 1 then
    UI_OUTFIELD Titre ,15,i*25 ,120,20
    UI_INFIELD Param , 140,i*25,240,20
    !ENDIF

    ENDWHILE

    Tonio

  • #1535

    Csilla Mai
    Keymaster

    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

    • #1540

      antoine JULLIEN
      Participant

      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

    • #1541

      antoine JULLIEN
      Participant

      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

      Tonio

  • #1538

    antoine JULLIEN
    Participant

    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+1

    if Param = “1” THEN
    hideparameter Param
    lock Param

    ELSE
    UI_OUTFIELD Titre ,15,i*25 ,120,20
    UI_INFIELD Param , 140,i*25,240,20

    ENDIF

    ENDWHILE

    Tonio

    • #1539

      antoine JULLIEN
      Participant

      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

  • #1543

    Csilla Mai
    Keymaster

    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 object

    for 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

    Csilla Mai
    Library Developer, Library Team
    GRAPHISOFT SE

    • #1547

      antoine JULLIEN
      Participant

      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 dynamicaly

      Attachments:

      Tonio

    • #1549

      antoine JULLIEN
      Participant

      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 2

      2:
      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 3

      3:
      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 4

      4:
      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 5

      5:
      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 6

      6:
      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 7

      7:
      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 8

      8:
      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 9

      9:
      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 10

      10:
      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 11

      11:
      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 12

      12:
      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 13

      13:
      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 14

      14:
      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 15

      15:
      IF GerMaterial_15 > 1 THEN
      UI_OUTFIELD “Boutons”,15,i+350,200,20
      UI_INFIELD “GerMaterial_15”, 140,i+350,240,20

      ENDIF

      Tonio

  • #1576

    Csilla Mai
    Keymaster

    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

  • #1599

    Csilla Mai
    Keymaster

    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.

    Csilla Mai
    Library Developer, Library Team
    GRAPHISOFT SE

    • #1605

      antoine JULLIEN
      Participant

      thank’s a lot, i’ll try your solution ! i need to install archicad 19 , i’m in 18 !

      Tonio

You must be logged in to reply to this topic.