title: How to Query a Radiobutton Collection in Python?
body: <p>I have this code in python that has to query three radiobuttons created for a window in maya..This is the code I have so far, I can query the sliders but I don't get how to query radiobuttons..</p>
  
  <pre><code>import maya.cmds as cmds
  
  #def function1(value):
  def function1(value1,value2):
      print(value1)
  
  def function2(value):
      print(value)
  
  
  def createUI(): 
      cmds.window("Window")
      cmds.columnLayout( adjustableColumn=True )
      value1 = cmds.intSliderGrp(label='number of moons', minValue=4, maxValue=20, value=12, field=True)
      value2 = cmds.intSliderGrp(label='Distance from parent to child', minValue=5, maxValue=40, value=20, field=True)
  
      DirectionControl = cmds.radioCollection()
      Direction0 = cmds.radioButton( label='Front')
      Direction1 = cmds.radioButton( label='Back')
      Direction2 = cmds.radioButton( label='Random')
      cmds.radioCollection( DirectionControl, edit=True, select=Direction0 )
  
  
      cmds.button(label = "OK", command = lambda *args: function1(cmds.intSliderGrp(value1, query=True, value=True), cmds.intSliderGrp(value2, query=True, value=True),cmds.radioButtonGrp(Direction1, query=True, value=True)))
      cmds.showWindow()
  
  
  createUI()
  </code></pre>
  
  #
  
  <p>This line:</p>
  
  <pre><code>cmds.button(label = "OK", command = lambda *args: function1(cmds.intSliderGrp(value1, query=True, value=True), cmds.intSliderGrp(value2, query=True, value=True),cmds.radioButtonGrp(Direction1, query=True, value=True)))
  </code></pre>
  
  <p>works if we remove the statement related to the radiobuttons..</p>