hexagon logo

Can we use Python commands in commands attributes during creating custom dialogue box?

Can we use Python commands in commands attributes during creating custom dialogue box?
Parents
  • Hi,
     
    You can use something like this in your dbox definition (some manual edits to the cmd):
    !
    interface dialog_box create &
      dialog_box_name = .gui.dbox1 &
      location = 844.0, 281.0 &
      height = 200.0 &
      width = 400.0 &
      units = pixel &
      horiz_resizing = scale_all &
      vert_resizing = scale_all &
      title = "dbox1" &
      iconifiable = no &
      start_commands = "var set var=$_self.ans int=(eval(run_python_code('test_module.execute_some_commmands()')))" &
    ....
     
    !
    language switch_to python
    import test_module
    Adams.switchToCmd()
    !
     
    I hope this helps.
     
    Regards,
    Rishi
Reply
  • Hi,
     
    You can use something like this in your dbox definition (some manual edits to the cmd):
    !
    interface dialog_box create &
      dialog_box_name = .gui.dbox1 &
      location = 844.0, 281.0 &
      height = 200.0 &
      width = 400.0 &
      units = pixel &
      horiz_resizing = scale_all &
      vert_resizing = scale_all &
      title = "dbox1" &
      iconifiable = no &
      start_commands = "var set var=$_self.ans int=(eval(run_python_code('test_module.execute_some_commmands()')))" &
    ....
     
    !
    language switch_to python
    import test_module
    Adams.switchToCmd()
    !
     
    I hope this helps.
     
    Regards,
    Rishi
Children
No Data