Suppose you have 3 expressions called 'length', 'width' and 'height' and you'd like to automatically update the part attributes called ATTR_length, ATTR_height and ATTR_width accordingly.
(Why in the earth would I want to do that, you might ask- these values could well be part list columns, or some dirty ERP trick might be the case. Actually I need neither, but it's good to know that this can be done !)
In the Expressions window, you need to create a dummy number expression, say 'test'. This needs to be a number, not a string variable.
Then you need to set the value of 'test' using the following syntax :
- test = ug_setPartAttrValue( "ATTR_length", stringValue(length) )
You can also get the value of an existing attribute, and assign it to an expression. This time, the syntax is :
- test2 = MakeNumber( ug_askPartAttrValue( "ATTR_width" ))
In order not to have lots of these dummy test variables, you could create a combined dummy, like:
- test = ug_setPartAttrValue( "x", stringValue( p1) ) + ug_setPartAttrValue( "y", stringValue( p2) ) +ug_setPartAttrValue( "z", stringValue( p3) )
