Cancel
Showing results for 
Search instead for 
Did you mean: 

Name an object with a value in a variable

Creator
Creator

Good morning, I have different buffers called (buffer1, buffer2,buffer3, buffer4.....) and I would like to take a property of one of them depending of the value of a variable in the code. For example:

 

I have a variable j with a value of 2 (j:=2) so I want to take the property NumMU of the buffer2. I have try to use something like .Models.Frame.Buffer&j&.NumMU but it doesnt work.

 

Any idea?

 

Thank you for your time

2 REPLIES

Re: Name an object with a value in a variable

Siemens Phenom Siemens Phenom
Siemens Phenom

This will do the trick:

str_to_obj("Buffer" + j).NumIn

 

In versions older than 13.0 you need to do it this way:

str_to_obj(to_str("Buffer", j)).NumIn

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: Name an object with a value in a variable

Creator
Creator

Thank you!!!!!!