Access CATIA V5 with win32com (LONG)

Discussion in 'Python' started by goermezer@htp-tel.de, Nov 18, 2004.

  1. Guest

    Hello,

    I got it ! There was an example (for Office I think) in the test-directory of
    Pywin32, where I have the first lines from. But this is dynamic binding. Can
    anybody explain this for early binding ?

    And it would be fine when the pulldown-menu in Pythonwin works to see the
    exposed Methods of the Type Libraries.
    -----------------------------------------------------------

    import win32com.client

    dispatch = win32com.client.dynamic._GetGoodDispatch("CATIA.Application")
    typeinfo = dispatch.GetTypeInfo()
    attr = typeinfo.GetTypeAttr()
    olerepr = win32com.client.build.DispatchItem(typeinfo, attr, None, 0)
    catia = win32com.client.dynamic.CDispatch(dispatch, olerepr)
    dispatch = typeinfo = attr = olerepr = None

    doc = catia.ActiveDocument.Product
    print "------------------"
    print "Number : Partname:"
    print "------------------"
    count = catia.ActiveDocument.Product.Products.Count
    for partnum in range(count):
    print "Part", partnum + 1, ":",
    catia.ActiveDocument.Product.Products.Item(partnum+1).Name
    ---------------------------------------------------------------

    This is the result. And it works fine.

    ------------------
    Number : Partname:
    ------------------
    Part 1 : 433275-14.1
    Part 2 : Part1.1
    Part 3 : Part3.1
    Part 4 : Product5.1

    ------------------------------------
    htp - Hannovers Telefon Partner GmbH
    http://www.htp-tel.de
    , Nov 18, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SoftStore2005
    Replies:
    0
    Views:
    1,334
    SoftStore2005
    Jan 10, 2006
  2. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    653
    Eric Sosman
    Jul 8, 2003
  3. Replies:
    0
    Views:
    779
  4. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,170
    Peter Shaggy Haywood
    Sep 20, 2005
  5. Vikas
    Replies:
    1
    Views:
    452
    David Harmon
    Aug 15, 2007
Loading...

Share This Page