cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
Njegos T
Contributor

n REQUEST for name of surface

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 Solution

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

Go to 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
Barry Kelly
Moderator

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
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!!

Barry Kelly
Moderator

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

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. 


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!