title: Maya Python How do I make a curve out of multiple collected points in a for loop
body: <p>I have a forloop to get all the positions in a list of locators, I need this info to create a curve of all the points. but when I put the cmds.curve in the forloop it creates several curves and when I put it outside of it there only is one curve on the last position in the list.
  Does someone have a solution for this?</p>
  
  <pre><code>    for locator in state:
  
          print("\t", locator)
          translate_x_value = cmds.getAttr("%s.translateX" % locator)
          translate_y_value = cmds.getAttr("%s.translateY" % locator)
          translate_z_value = cmds.getAttr("%s.translateZ" % locator)
  
  
          cmds.curve(p=translate_x_value,translate_y_value,translate_z_value))
  </code></pre>