title: Autodesk Inventor API with Python
body: <p>I try to use Python for Autodesk Inventor API. For example, I try to make a new sketch in an Inventor part document that I make with Python.</p>
  
  <p>But I have a problem with adding sketches. All of my tries were wrong.
  Here's an example of code (one of a lot):</p>
  
  <pre><code>import win32com.client
  
  from win32com.client import constants
  
  
  invApp = win32com.client.Dispatch("Inventor.Application")
  invApp.Visible = True
  
  asd = invApp.Documents.Add(constants.kPartDocumentObject,"",True)
  
  nsk = asd.PartDocuments.ComponentDefinition.Sketches.Add()
  </code></pre>
  
  <p>There is an error: </p>
  
  <pre><code>AttributeError: '&lt;win32com.gen_py.Autodesk Inventor Object Library.Document instance at 0x284773312&gt;' object has no attribute 'PartDocuments'
  </code></pre>
  
  <p>I tried to find the right way to call the attributes but I have not had any success.</p>