473,508 Members | 4,324 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access CATIA V5 with win32com (LONG)

Hello,

I have some problems to automate a CAD (computer aided design) Software called
CATIA V5 from Dassault Systemes.

CATIA V5 has a builtin VB-Editor like Word, Excel, … and registers itself as a
COM-server. With VB one can automate everything in CATIA V5 with a lot of
registered Object Libraries.

A VB example:
...
'Create a new product document object by adding a document with the
Product
'type to the document collection of the CATIA application.
Dim oProductDoc As Document
Set oProductDoc = CATIA.Documents.Add("Product")

'Retrieve the root product.
Dim oRoot As Product
Set oRoot = oProductDoc.Product

'Retrieve the root product collection of products.
Dim oRootCol As Products
Set oRootCol = oRoot.Products
...

The problem is that CATIA V5 has not only one Object Library like Word or Excel
to get access for. Dassault splitted all functionalities of the CAD system
to separate Object Libraries. Therefore to automate this CAD-system with Python
I want to use the following Type Libraries in a script.

"CATIA V5 Interfaces Object Library" to get access to the core functionalities
of the CAD system (the Application):
Similar to "Dim mydoc as Document" in VB - but in Python

"CATIA V5 ProductStructureInterfaces ObjectLibrary" to get access to the parts
of an mechanical assembly:
Similar to "Dim my_product_document as Product" in VB - but in Python

This should use both TypeLibs:

import win32com.client
catapp = win32com.client.Dispatch("CATIA.Application") # Connects to CATIA V5
and uses CATIA V5 Interfaces Object Library
my_product_document = catapp.ActiveDocument.Product #".Product" makes the error
my_product_document.Count()

But the last 2 lines gives me the following error:
AttributeError: '<win32com.gen_py.CATIA V5 InfInterfaces Object Library.Document
instance at 0x19543064>' object has no attribute 'Products'

Yes OK, the attribute "Product" is from "CATIA V5 ProductStructureInterfaces
Object Library" (which has the CLSID {5065F8B6-61BB-11D1-9D85-0000F8759F82})
and not from "CATIA V5 Interfaces Object Library" ("CATIA.Application") which I
automatically use.

When I try to use the CLSID of "CATIA V5 ProductStructureInterfaces Object
Library" I get a Class not registered:

import win32com.client
catapp = win32com.client.Dispatch("CATIA.Application") # Connects to CATIA V5
Interfaces Object Library
catprod = win32com.client.Dispatch("{5065F8B6-61BB-11D1-9D85-0000F8759F82}")#
Connects to CATIA V5 ProductStructureInterfaces Object Library

To get access to the wanted ProductDocument Object I get an error:
com_error: (-2147221164, 'Class not registered', None, None)

How can I register it ?

And how can I use both TypeLibs and can have access to the very important
Product-Object? The builtin VB editor makes everything
automatically...

best regards

Mustafa Görmezer

------------------------------------
htp - Hannovers Telefon Partner GmbH
http://www.htp-tel.de
Jul 18 '05 #1
0 4041

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3524
by: DD | last post by:
Hello, Could anyone please help me?? Is there somebody who could explain me how to make a connection to a access database with a python cgi script. I would like to use common sql commands in my...
0
605
by: goermezer | last post by:
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...
3
2392
by: Mark Line | last post by:
Hello! I'm a python n00b! I've been writing in c++ for a few years so programming's not new to me, just python that I don't know the syntax!
1
7761
by: DD | last post by:
Hello, Could anyone please help me?? Is there somebody who could explain me how to make a connection to a access database with a python cgi script. I would like to use common sql commands in my...
4
1837
by: bytecolor | last post by:
Hi people, Using win32com on 2k SP3... >>> import win32com.client as w32c >>> fc = w32c.Dispatch('Featurecam.Application') >>> fc.InstallPath u'C:\\PROGRA~1\\FEATUR~1' >>> Using win32com...
0
2992
by: Grasshopper | last post by:
I am the as beginner as they come to VB 6.0. My project is to control another program through CATIA DesignTables (parameterized Excel sheets that update a CATIA model) through a VB interface. So I...
2
1391
by: admv4 | last post by:
I want to know if it is possible to make a Windows file system or drive accessable to be written to and read from in Catia? I am running Catia V4.2 operating on AIX V5.3. I think that Microsoft has a...
3
2693
by: Iain King | last post by:
I'm manipulating an MS Access db via ADODB with win32com.client. I want to rename a field within a table, but I don't know how to. I assume there is a line of SQL which will do it, but nothing...
2
2938
by: tedpottel | last post by:
Hi, I cannot get the following code to work import win32com.client import time engine = win32com.client.Dispatch("DAO.DBEngine.36") db=engine.OpenDatabase(r"testdate2.mdb") access =...
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.