<div dir="ltr">Hello Mark,<div><br></div><div>Thank you for the response.</div><div><br></div><div>Just to share Erwin is an Data Modelling tool. I wanted to access Erwin through python and perform manipulations on DataModel through it.</div><div><br></div><div>Regards,</div><div><br></div><div>Pranav</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 17, 2023 at 6:21 PM Mark Hammond <<a href="mailto:mhammond@skippinet.com.au">mhammond@skippinet.com.au</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>

  
    
  
  <div>
    <p>I'm sorry, but you are very unlikely to find anyone on this list
      with erwin experience. pywin32 is a general purpose library that
      allows talking to *any* COM object, so there are literally
      hundreds and hundreds of different apps it can work with. I've
      never even heard of erwin and have no idea what it does :( You
      might fine someone else on this list has, and can help you, but in
      the meantime...<br>
    </p>
    <p>You really need to find support for the erwin app, not pywin32.
      Because COM works in any language, you might find the help you
      need is written in terms of a language other than Python, but the
      answer should translate across to Python.<br>
    </p>
    <p>Good luck,</p>
    <p>Mark<br>
    </p>
    <div>On 2023-05-17 5:39 a.m., Pranav S Pawar
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">Hello Team,
        <div><br>
        </div>
        <div>I am getting an error while using
          persistence_units.CloseAll() method of persistence_units
          module. of win32com</div>
        <div><br>
        </div>
        <div>Error: <span style="font-size:14px;white-space:pre-wrap;box-sizing:border-box;color:rgb(178,43,49);font-weight:bold">AttributeError</span><span style="color:rgb(0,0,0);font-size:14px;white-space:pre-wrap">: '<win32com.gen_py.erwin Data Modeler Script Client API Type Library.ISCPersistenceUnitCollection instance at 0x3171750852880>' object has no attribute 'CloseAll'</span></div>
        <div><br>
        </div>
        <div>Below is my code where i am trying to access and erwin
          datamodel , check connection and close connection.<br>
          <div><br>
          </div>
          <div>i<i>mport win32com.client as win32<br>
              <br>
              # Create an instance of the erwin API<br>
              erwin_api = win32.Dispatch("erwin9.SCAPI")<br>
              <br>
              # Connect to erwin Data Modeler Mart or local repository<br>
              # Get the PersistenceUnits collection<br>
              persistence_units = erwin_api.PersistenceUnits<br>
              <br>
              # Open an existing persistence unit<br>
              existing_persistence_unit =
              persistence_units.Add(r"D:\\testdm.erwin")<br>
              print("Opened existing persistence unit:",
              existing_persistence_unit.Name)<br>
              <br>
              # Close all persistence units<br>
              persistence_units.CloseAll()<br>
              print("Closed all persistence units")<br>
              <br>
              # Save changes to all persistence units<br>
              #persistence_units.SaveAll()<br>
              print("Saved changes to all persistence units")</i><br>
          </div>
          <div><br>
          </div>
          <div>Can you please let me know, what is the correct method if
            CloseAll is not the correct method.</div>
          <div>Is there any link where I can get all the methods of
            erwin_api.PersistenceUnits ?</div>
          <div><br>
          </div>
          <div>Thanks,</div>
          <div><br>
          </div>
          <div>Pranav</div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
python-win32 mailing list
<a href="mailto:python-win32@python.org" target="_blank">python-win32@python.org</a>
<a href="https://mail.python.org/mailman/listinfo/python-win32" target="_blank">https://mail.python.org/mailman/listinfo/python-win32</a>
</pre>
    </blockquote>
  </div>

</blockquote></div>