Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Get building material name from ID

Kaj_AL
Booster

Hi everyone!

 

In my GDL object Properties script, I have building material and material information that I would like to translate from Index to Name.

 

For example, I have a building material with index 97 and the name Offices. In my lists, I use the building material as a unit. Right now, I have written

IF bui_mat=97 THEN program="Offices"

which obviously isn't the best way to do it (and is prone to mistakes), but I just can't figure out how to do it. I've tried following guides with different REQUEST codes, but I'm doing something wrong. How do I do this?

 

Thank you!

/Kaj

Archicad 24-25 SWE
Dell Precision 5560, Windows 10 Pro
11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz 2.61 GHz
1 ACCEPTED SOLUTION

Solution
Barry Kelly
Moderator

n = REQUEST ("Name_of_building_material", index, name)
Returns in the variable the building material name identified by index.

 

This should work for you.

You add the index number and it will tell you the name in the 'name' variable.

 

So in your case...

n = REQUEST ("Name_of_building_material", 97, name)

PRINT name (or do what ever else it is you want to do with 'name'.

 

 

Barry.

 


One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

View solution in original post

2 REPLIES 2

Solution
Barry Kelly
Moderator

n = REQUEST ("Name_of_building_material", index, name)
Returns in the variable the building material name identified by index.

 

This should work for you.

You add the index number and it will tell you the name in the 'name' variable.

 

So in your case...

n = REQUEST ("Name_of_building_material", 97, name)

PRINT name (or do what ever else it is you want to do with 'name'.

 

 

Barry.

 


One of the forum moderators.
Versions 6.5 to 25
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Dell Precision 3510 - i7 6820HQ @ 2.70GHz, 16GB RAM, AMD FirePro W5130M, Windows 10

View solution in original post

So close to what I did, but so far! Thanks, works great!

Archicad 24-25 SWE
Dell Precision 5560, Windows 10 Pro
11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz 2.61 GHz

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!