hexagon logo

What is python command if I want to modify the value of a design variable? e.g. DV1 exists in database with current value 10, want to change to 20

What is python command if I want to modify the value of a design variable?
e.g. DV1 exists in database with current value 10, want to change to 20
Parents
  • Thanks for reply and it worked.
    I want to extend here more little bit,
     
    I have created cmd script where value of design variable is changed 1 unit until last value and solver files are exported
    if condition=(DB_EXISTS("ip"))
      variable modify variable= ip & 
      integer = 0
    else
      variable create variable= ip & 
      integer = 0
    end
    while condition=(ip < 5)
    variable modify variable_name=ip integer_value=(eval(ip+1))
    variable modify variable= DV_1 &
    real = (eval(ip))
    simulation set solver_preference = write_files_only
    simulation set file_prefix = (eval("iteration_" // RTOI(ip)//"D"))
    simulation single scripted &
       sim_script_name = SIM_SCRIPT_1 
    end
    variable modify variable_name=ip integer_value=0
     
    how to use interval value such as 0.5 or 0.2 like that instead of 1 or 2.
     
    and how to do script with python loops as well.
     
    thanks
Reply
  • Thanks for reply and it worked.
    I want to extend here more little bit,
     
    I have created cmd script where value of design variable is changed 1 unit until last value and solver files are exported
    if condition=(DB_EXISTS("ip"))
      variable modify variable= ip & 
      integer = 0
    else
      variable create variable= ip & 
      integer = 0
    end
    while condition=(ip < 5)
    variable modify variable_name=ip integer_value=(eval(ip+1))
    variable modify variable= DV_1 &
    real = (eval(ip))
    simulation set solver_preference = write_files_only
    simulation set file_prefix = (eval("iteration_" // RTOI(ip)//"D"))
    simulation single scripted &
       sim_script_name = SIM_SCRIPT_1 
    end
    variable modify variable_name=ip integer_value=0
     
    how to use interval value such as 0.5 or 0.2 like that instead of 1 or 2.
     
    and how to do script with python loops as well.
     
    thanks
Children
No Data