Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Parameter Label

Anonymous
Not applicable
Hi,
I am having real difficulty creating a label for an object I have made.
It is an object with a parameter that when I change it, it changes the panel material colour.
Now I have got this label to work, however it comes up with error messages within the 2D script. Im sure it is just because I have coded it a bit messy.
Does anyone have any ideas how I could code this and avoid the error?
6 REPLIES 6
Anonymous
Not applicable
Tom,
Is this object a LABEL or a general object?
Because I have a problem when I try to load it as a label object:
Anonymous
Not applicable
Hi,
Sorry I have just realised how rushed and rude my first comment was.
It is an ArchiCAD 16 Label
Basically I have used the following command in the master script

pc=REQUEST ("ASSOCLP_PARVALUE", "pcolour", nameind_pc, type_pc, flag_pc, dim1_pc, dim2_pc, val_pc)

Now what I want to use in the 2D script is the 'val_pc'

In the object I want to label I have the parameter 'pcolour' with the values (val_pc)
01 Black Caviar
02 Highlander
03 Jurassic Park
......
18 Vivid White

I want to know how to translate this into text to use in a text2 command.

Then I want to split the text so I only see the number (eg, '01')


Im guessing I use the STW then SPLIT commands, but my puny brain cant work it out.

Tom
Anonymous
Not applicable
Hello,

findspace= strstr(val_pc, " ")
codeonly= strsub(val_pc, 1, findspace-1)
text2 0, 0, codeonly

Hope this works
Anonymous
Not applicable
Thanks Juha,
The code you did essentially works, however I get the 2D code error of 'STRING TYPE EXPESSION'.
This is quite frustrating as when I open the label tool, I get this message popping up.

Is there something I need to type after the REQUEST command in the master script the change the expression?
Anonymous
Not applicable
Just got it workings.
I just needed to add val_pc as a parameter, which I made hidden.

Works great.
Thank you!
If You added before the operations:
val_pc=""
You would not need to add it as parameter.

Best Regards,
Piotr