2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations
2022-03-11 10:45 AM
Hi everyone,
I need help how to write script to pull parameter for name of surface.
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".
I anyone know hot to write code to get instead number "231" surface name "RAL 7032" I'd be very thankfull! 🙂
Solved! Go to Solution.
2022-03-11 11:27 AM
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!!
2022-03-11 10:56 AM
n = REQUEST ("Name_of_material", 231, mat)
That should return the name of material index number 231 to the variable mat
Barry.
2022-03-11 11:06 AM
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.
2022-03-11 11:27 AM
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!!
2022-03-11 04:52 PM
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.
2022-03-14 08:24 AM
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.