hexagon logo

Assigning a variable from a variable assignment

Hello I would like to do something like the following but I cannot get it to work and coffee has still to hit my this Friday morning:

Assign - Counter=1
Assign - V1=1
Assign - VCALL="V"+Counter

Now, I would like for VCALL to take the value of 1 instead of the string "V1". Keep in mind that this is a super simplified example but should give the idea of what I am after. I tried these pointer brackets {} but they don't seem to work. Creating a function does not seem to work either. I am getting a string with the name of the variable instead of the value in the variable :S

Any help here guys please?
Parents
  • So I found a way...

    ASSIGN/V1=5
    ASSIGN/COUNTER=1
    ASSIGN/V2="V"+COUNTER
    ASSIGN/V3=V2.X
    F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
    NOM/XYZ,<0,0,0>,$
    MEAS/XYZ,<V3,0,0>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>​


    F1.X will have the value 5 that I am after. Still..... there should be an easier way apart from the Array solution proposed by neil. I am not sure why ASSIGN/V2={"V"+COUNTER} does not work
Reply
  • So I found a way...

    ASSIGN/V1=5
    ASSIGN/COUNTER=1
    ASSIGN/V2="V"+COUNTER
    ASSIGN/V3=V2.X
    F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
    NOM/XYZ,<0,0,0>,$
    MEAS/XYZ,<V3,0,0>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>​


    F1.X will have the value 5 that I am after. Still..... there should be an easier way apart from the Array solution proposed by neil. I am not sure why ASSIGN/V2={"V"+COUNTER} does not work
Children
No Data