cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Kaj_AL
Enthusiast

Get building material name from ID

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-27 SWE
Dell Precision 5560, Windows 11 Pro
11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz 2.61 GHz
1 Solution

Accepted Solutions
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 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

Go to post

2 Replies 2
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 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
Kaj_AL
Enthusiast

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

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

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!