We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

GDL
About building parametric objects with GDL.
SOLVED!

n REQUEST for name of surface

Njegos T
Contributor

Hi everyone,

I need help how to write script to pull parameter for name of surface.

NjegosT_0-1646990199558.png

 

I've tryed with 
n = REQUEST ("Name_of_material", "c", mat) and result that is writen in label is "GENERAL" no metter which surface I set in object, so I tryed with
n= REQUEST ("ASSOCLP_PARVALUE_WITH_DESCRIPTION", "c", name_or_index, type, flags, dim1, dim2, mat) and result is number of surface "231". 

NjegosT_1-1646991035157.png

 

NjegosT_2-1646991322040.png

I anyone know hot to write code to get instead number "231" surface name "RAL 7032" I'd be very thankfull! 🙂




1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Njegos T
Contributor

It work now. First I get the number of material
n= REQUEST ("ASSOCLP_PARVALUE_WITH_DESCRIPTION", "c", name_or_index, type, flags, dim1, dim2, matnum)
and then from number I got the name
n = REQUEST ("Name_of_material", matnum, mat)

Thanks a lot!!

View solution in original post

5 REPLIES 5
Barry Kelly
Moderator

n = REQUEST ("Name_of_material", 231, mat)

 

That should return the name of material index number 231  to the variable mat

 

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

Or use ...

 

n = REQUEST ("Name_of_material", c, mat)

 

Without the quotes around c (your surface variable).

c is the index number so you already have that.

 

 

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
Solution
Njegos T
Contributor

It work now. First I get the number of material
n= REQUEST ("ASSOCLP_PARVALUE_WITH_DESCRIPTION", "c", name_or_index, type, flags, dim1, dim2, matnum)
and then from number I got the name
n = REQUEST ("Name_of_material", matnum, mat)

Thanks a lot!!

But if you have the parameter c for your material, you already have the number.

So just use c without quotes.

 

Unless it is in the Master or Parameter script, then you have to do it as you stated with ASSOCLP_PARVALUE_WITH_DESCRIPTION

 

I always forget that.

 

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

This script is for label, so first I need to get value (number of surface) from object and then transform number to name of surface. If I use c without quotes result is "GENERAL" instead of name.