Cancel
Showing results for 
Search instead for 
Did you mean: 

Formula result as first valid value result in a part family Property

Experimenter
Experimenter

I've built a code in the valid values tab of a property to update dinamically the valid values result array according to the user inputs. Since I don't have a static result for the Formula result that is always included in the valid values, I don't know how to set the Formula result to the first valid value dinamically.

Thanks in advance

4 REPLIES

Re: Formula result as first valid value result in a part family Property

Valued Contributor
Valued Contributor

In the Formula for the property write:

result = Me.ValidValues("PropName").Keys(0)

 I also reccomend to check first if this value exist if potentially the valid values list can be empty.

 

Re: Formula result as first valid value result in a part family Property

Experimenter
Experimenter

Kirill_El, thanks a lot for your help

Re: Formula result as first valid value result in a part family Property

Valued Contributor
Valued Contributor

Hi Carico,

 

Another way to do it is:

 

Result = ValidValues("PropertyName").FirstDisplayValue (or FirstValue, or LastDisplayValue or LastValue)

 

Dharmesh

Highlighted

Re: Formula result as first valid value result in a part family Property

Valued Contributor
Valued Contributor

If your validvalues are dynamic it might be also worth to check if validvalues contains any value before referencing to Keys array, firstValue or anything else. Otherwise if VV will be empty you may recieve errors.