Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Access CATIA V5 with win32com (LONG)

Thread Tools

Access CATIA V5 with win32com (LONG)
Posts: n/a

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.Ap plication")
typeinfo = dispatch.GetTypeInfo()
attr = typeinfo.GetTypeAttr()
olerepr =, 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
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Software:Ansys DesignSpace,VectorWorks,AUTODESK,WILCOM,CATIA prosoft Software 3 02-09-2012 09:07 PM
REQ Full Time Consultant-PLM/CATIA/VPM/ENOVIA/CAA: Long Beach CA Vikas C++ 1 08-15-2007 09:05 PM
Cad/cae/cam=>autocad/adobe/artcam/arcgis/catia/lectra/master SoftStore2005 ASP .Net 0 01-10-2006 04:38 PM
Access CATIA V5 with win32com (LONG) Python 0 11-18-2004 01:23 PM