BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Changing material parameter via UI

Anonymous
Not applicable
Hi guys.

It feels like I´m very close, but I´v been stuck for a while now, hope someone can give me a clue!...

Im trying to create a single UI page from which predefined materials/surfaces can be chosen.

However with a surface parameter placed in a UI_INFIELD code, I can only make it choose between the surfaces from the indexed library.

If using a integer parameter in the UI script, I can´t make it control my surface parameter without getting this error:

" possibly unwanted parameter change at line... "

I created surfaces in the MasterScript via "Define Material" but It seems I can´t make the surface/material parameter choose anything but a numeric value, hence the indexed library surfaces...

I´ve tried some overwriting in the Parameter script, but nothing worked so far.

Here´s the UI code with the "testp1" parameters as an integer:

ui_infield "testp1",20,60,310,70,
1,"4c400x100",4,1,
70,70,40,40,

1,"Red",
2,"Yellow",
3,"Blue",
4,"Green"


And the Parameter script:

values "testp1" 1,2,3,4


PARAMETERS mat= testp1
IF mat=1 THEN
mat1= "Red"
ENDIF
IF mat=2 THEN
mat1= "Yellow"
ENDIF
IF mat=3 THEN
mat1= "Blue"
ENDIF
IF mat=4 THEN
mat1= "Green"
ENDIF

!PARAMETERS mat1=mat1


Any tips, help or guidance will be highly appreciated...
2 REPLIES 2
The point is what You are going to achieve.

In the libraries I prepared in most cases, due to users wish, I implemented a switch that was responsible for switching the internal surface and the user selectable one. The internal materials' list must be made in Parameter script and then placed as UI_INFIELD - the pic menu can be made with single files (You can use the same pics as the textures, but if it would be better to resize and make special pisc for that usage - I hate the matrix pictures because the unneded effort must be made to prepare such)

The both UI_infield's for the project surfaces and the internal ones can be placed in the same place in the UI...but the switch have to be handy somewhere to select the proper set.

The example of the UI for internal surface selector:

ui_infield{3} "materialx", xx,yy, dim_x,dim_y,
2,"",12,2,
30,30,29,29,
"mat1_m.jpg", "MAT1-description", "MAT1",
"mat2_m.jpg","MAT2-description","MAT2"

the pix dimensions in this case are 29x29 pixels + 1 pixel extra as the frame in both directions
2 means the way the button works, "" means that there wil not be the "matrix" bitmap, next 2 (12,2) may be left alone with any value if not the matrix bitmap is used, but the individual ones.

of course the parameters script must contain:

VALUES "materialx" "MAT1", "MAT2" ....

and the "materialx" parameter type is string.

Best Regards,
Piotr
Anonymous
Not applicable
Hi Piotr.

Thx. for your reply...

I made work by using the UI_infield{3}

Thank you...
Learn and get certified!