Get building material name from ID
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2021-10-22
09:07 AM
- last edited on
ā2024-09-09
11:19 AM
by
Doreena Deng
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
Dell Precision 5560, Windows 11 Pro
11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz 2.61 GHz
Solved! Go to Solution.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2021-10-22 09:43 AM
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.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2021-10-22 09:43 AM
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.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā2021-10-22 10:42 AM
So close to what I did, but so far! Thanks, works great!
Dell Precision 5560, Windows 11 Pro
11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz 2.61 GHz