development of a modular api for the cad-system catia v5 · pdf filedevelopment of a modular...

46
Development of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden 2004 TRITA-NA-E04088

Upload: doankhanh

Post on 03-Feb-2018

224 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

Development of a Modular APIfor the CAD-System Catia V5

TOMAS FORS

Master’s Degree ProjectStockholm, Sweden 2004

TRITA-NA-E04088

Page 2: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

Numerisk analys och datalogi Department of Numerical AnalysisKTH and Computer Science100 44 Stockholm Royal Institute of Technology

SE-100 44 Stockholm, Sweden

TOMAS FORS

TRITA-NA-E04088

Master’s Thesis in Computer Science (20 credits)at the School of Computer Science and Engineering,

Royal Institute of Technology year 2004Supervisor at Nada was Inge Frick

Examiner was Stefan Arnborg

Development of a Modular APIfor the CAD-System Catia V5

Page 3: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

Abstract

����������������������� ��������� ����� �������������� ��� ������������������ �������������������� !"����� ������ �����������# $���������������������%����������� ������������� !�� ����������������� ����"�

�������������������� �������������������� �������� �������������������&���������������������������� ������� �"�

'����������������� �� ����������� ���������������� ���������������� ��������������� ���������� �������� �"�

���� ������ ����������������������������� ������� ���� ����#��������� ��������(�������������� ��#������� #�������)���������� �������������� ������ ������������ ������"�* #����������� ������������������������������������ ������� ����(������������������� ���������������������������� ����� ��#���������#����"���� ������������ ����� ����������� ������� ������������#���������� ������������� ���� ��#������������"�

Utveckling av ett modulärt gränssnitt för CAD-systemet Catia V5

Sammanfattning

�����+��������������������$������������� ���������,���������-������������������ !"�. �������$ �������,�����������������%������ ����������������������� !��-�������������$������� ���� �$���������"�

/��� �����$����������� ���,����������$���������-�0�� ������$���$���-���,��������� ���������$ ��������� �����"�

���������������$���� �� �����$�����$�� �������� ���,���������$���������-�0�� ������$���� ��� ���$����$�������-�0����1���$�"�

2�������������� ���,���������,����������� ���������,��������,��������-0����"�������������� ��� ���$�������������������+������������������(�1������ ���-�����,������������-0�������$�� ������"��,� ��,�����,$���1������,�����������-������$�����������(��������������,�-������������$���������� ���,����������$��������,�����$���������� �"��,�-��-����� �����������$����������,����������$�����������������$���������� ���������������� �$������ ��������������%"�

Page 4: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

!�"����������

# ���� ����� $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#

% ������� $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%

& '�����������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$& 3"4 � �� �������� � ��"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""3

3"4"4 � �� ��������5���"""""""""""""""""""""""""""""""""""""""""""""""""""""6 3"4"7 � �� ��������.�� � �� """""""""""""""""""""""""""""""""""""""""""""6

3"7 '������������""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""! 3"3 ������ ! """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""8 3"6 '�������������� !"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""8 3"! � �� ������������� ����������""""""""""""""""""""""""""""""""""""""""""9

3"!"4 :�0���� �� """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""; 3"!"7 ������������� """"""""""""""""""""""""""""""""""""""""""""""""""""""""< 3"!"3 � ������ �������� � """"""""""""""""""""""""""""""""""""""""""""""4= 3"!"6 ����(����������� ��������""""""""""""""""""""""""""""""""""""44 3"!"! � �������� """"""""""""""""""""""""""""""""""""""""""""""""""""""""""47 3"!"8 >���������� """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""47 3"!"9 ��� ������ ��"""""""""""""""""""""""""""""""""""""""""""""""""""""47 3"!"; /������������������� � """""""""""""""""""""""""""""""""""""""""""""""43

( �"������ ���������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#(

� ���������������"��� �����$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$#) !"4 � �� ��� �����������$�"""""""""""""""""""""""""""""""""""""""""""""""""48 !"7 ��������� ���������� �0���""""""""""""""""""""""""""""""""""""""""""""""""""""49

!"7"4 ?������""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""4; !"7"7 ��������� """""""""""""""""""""""""""""""""""""""""""""""""""""""""4; !"7"3 ?�������������#��� ��������� � """"""""""""""""""""""""4; !"7"6 '����+���� �""""""""""""""""""""""""""""""""""""""""""""""""""""""4<

!"3 ����������������������"""""""""""""""""""""""""""""""""""""""""""""""""""4<

) !�����$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%# 8"4 �������������(��� ���������� ������������� """"""""""""""""""""""""""""""77 8"7 ����������������������������������""""""""""""""""""""""""""""""""""""73

* +������ ����������� $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%� 9"4 2 ��������� ��""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""7!

'�"���������$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%*

����� �,� $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%- �"4 2�������""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""7;

����� �,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$%. >"4 %� ���������� ������������""""""""""""""""""""""""""""""""""""""""""""""""""""7< >"7 ����������������""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""37 >"3 @ ������������ �� """""""""""""""""""""""""""""""""""""""""""""""""""""""""67

��

Page 5: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

1

1 Introduction

��������� � ���������������������������� �� ������ ��� ����������������$� #�� #�������#� ��� ���������(��������� ��� ������������������������������� �������������� �������������"�

��������������#����� ���� ������� ���� ������������� ������������� ���"������������������������ �������������������� ������������������� ������ �� #��������"������������������ ����� ���������������� ������ ��)�#������ ���� �����������#���� ��������� ������"������ ��� ������������������� ���������������������"�'����� ��������������������������������������� ���������������������������#��"�

��������� ��������� ���$����� ������� ��������� �# $�#�������������� �����(��������������� ������(�������� ��� #������ �����������"������#���������������������� ����� �������+�������������(�� ����������� ��������������&��(�#�����#���������������������������������� ���"�

������������� ���� ������������������������������� ������������� ������������� ����� ��������������&���������������������������������������� ������� ���$������&������"�

:��� �������#���� �� �������������������� ��������������� ����������� � ��"������������������� ��������������������������� �������������������������������� ���������������"��

������������������� �����A��.A��B��� ���������������(�.�����������������B�������(������ ������ ����������������������� ��#�� ������������� ���������������������"�

������������������� ���������������������� �� ����� 0���# $���� ������������#�������� ��������������������� !(������������������2���C�����2�(�������������� ���������������� �����������"�

��������� !��������������������� ������� ����������������������#������������������������������������������ �� �������������$� #�� #����"�

��������� ����� ����������� ���������������� !�� �� �� #������ �� ������ �� #����������� ��(������������ ��� �������� ���������"�' ��������� �����������2���C���� �����������(����� �� ������������� ����������������"�

Page 6: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

2

2 Purpose

������ �� �������������#���� ��������������������(�#��������� �����#����������������������������������� ��������#��"���������� ����������������� �������� ��������������������������"�

>������������ ���������� �#������������ ������������ !����#������ ���#����� �������������� ���� �� ��� �����������$��������������������������������������#� �������� !"�

������������������������� �� ��� �������� �� �0����� �����������������������������$� #�� #������"���� ����#������������� ������������ ���������� ��+���������� �0���� ��� �����(���� ��� ������ ����������#���� �������������������������� ������"�

����������(�������������� ������������ ������ ��� ���� ����������������������������� ����� ���� ��������� #����������� ���#����������������# $"��

Page 7: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

3

3 Basic Concepts

�������������������� �������� !����#�������������������� ����# ��� ��� ��� ������������������������������������������ ���������� �������������������"���� �������������� �� ��������������� ������"�

3.1 Component technology

� �� ������������ ��� ���� ��� ��#����������#���������� �+����������(���� �������������������������"��������� ��������� � ����(������� �����������#������DD# ������ � ����&���� �����)������ ���E7==3F"�2������������� ������ #��������� �������������� ��������$����� ��� �� �������� � ������������� ������������ ��� �� ���������������������������"��

������(� ����� �(����� �������� ��#����������������������� ��+�������� �� ����(���������������� ���������������� �����&������"����� ������ ���� �������� � ��������� �� ��������������������� �������������������#��������� �� �������# $���� �#��������� �� �������� ������ ���������"�

� �� ������� ������������� �������� ������(�#������ ������������������� �� ����+� �������� ����� ���� ����� ������������"�������� ��� �� ������ ����������������� �+����(������������ �� ����������������������������"����� �� ������� ������� ������� ����#��� ���������� �$� #������������ ������������� ��������(���������� ���������������� ������� �� �������������#����� �� �������������������� ����������"�� �� ������� ����������� ��������#���� ���� �� �������� ������ ���#���������� ��"�

���� ������ ����������� ����������������� �������������� �� ����������������������� ���������"�. ���� �������������������� ��� ������������������� �+������ �������������������������#����� ����������������$������������������ ��G����������G��� �����:�0���.��������% ����:.%�"�:������������� ���������(�#�������� ������ ���� ������(�������� ������� ������ �� ����������# $������������� ���������������� �"���������� ���������������������� ��������� ��� ������������ ���� ���� ���������������� �������������� �������������������� ��������� ���� ������������"������ ������������������������������ ��������#����� ������������� ����� ���� ��������������� �"��������������������� ���������������������� ����������� ���������#�������������� ������������������� �� ������ �� ����"������������� ���#�������� ������ �� ����� �������# ����������������� ������� �������������������� ��"��������������# ����&��������������� ��������� �� ���������������#������������������ �������"�

�������� ���� ��$���� �����# $����� ����������� ��� �� ����"�2 �� #����������� ������ ���#����� �� �������� ���������� #�������� ��������������"�

Page 8: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

4

��� �� ����� ����������� ������������ ���������������� ���������� ���������$���������������������� �(��""���#��� �� ����� ���#��� �� �����������# $�E>�����������"�7===F"�

3.1.1 Components in Java

:��+����� ��� �� �������� � ���������������������������# $����������� �B������5����>����� ��2���.�� ������"������ ������� ���������������������������� ������������������������ �������������� ��������"�

���� �� ����(��""��������(����#���������� ��������������� ���������������5����� ���������������"���������������������� ��� ������������ ���:2����������(�������������������� ��5���(������������� ������������������ ��� �$������� ���� � ��� ���������������"�

������������� ��������� ����������������������������"����� ������� �������� ������������(��������� ����������������������#������������������������� ������ �� ����(������������ �����H��+� ������"�* #������ ����������������������#���������������� ������������� ������� � ��������# $"�������������� ����������������� ������"����������������������� ��� �� ����� �������������������������� ��#������������������� ������������� ���������� �����:2����������"�2������������ ������������� ���� �������$�I�� ��� ������� ��������������#� ���� ����������+�������#���EB������5����>����7"4����������F"�

3.1.2 Components by Microsoft

���� ���#�������� �� ���������������������:.�����������.�� � ����.2�:.�"�.2�:.����� ��������������� ������������������� �"�2����.�� � ����:.�2��������� ��E4<<!F"�

���������� ������������������� �����������������������.�� � ��"�������� ����������� ��� �� ������������$�� +�������������"�

2������ ����.2�:.���������������#���������� ���� �+� �� �0�������������������#������$����� ������� ������������� �� ����� �������� ��������"�2������� ������������������������������ ��� ������ ���� ������� ���������������"�������� ��������������������� �(������������������� ����� ���� ����������� �#�� ������# $"�

����� ������������� ��#� �#������ ������� �� ��������� $����������������&���������#���� ����&�������������� ����� ���"�������������#����� �������� �� ����������������(�#�����#���������������� ��������������������$�������� ����+����������������������� �����������"����������������������� �� ���(������ ������ �� ���(������������� ����� ���"����� ����#����������������������� ����� ����� ����#������� +�������� ������������� ��������� ��#������������������ �0��"�� ��������������� ��������� ������ ������� ��� �����������/���"����� ���� �� ���������������� �0������� #����$� #��� ��������������� ��������� �����������$����� ���������:.����# $"����/������&������������������������������ ������ ���������������� ����������������/������ ���������#��������������"�

Page 9: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

5

���.2�:.����# $���� ���$����� ���� ����������������"���������������� ������ ���#���������� ����.2�:.������ ��� ����� ���� �"�

���.2�:.�# $�� ��������������#�������$������ ������� �� ��#������������������������� �# $�� ���(������������������� ������ ��� ��#�������������� �# $�#�������� ������������������������� ��� ��:.����� � ��"�

B������.2�:.�������������������� ���������.2�J��� #����� ���������# $��������(����+�������������� ���� ���� ��.2�:.���� ��� ������������������������������ ������?��+���� ��"�

3.2 Features and CAD

. ������������������� ��� �������� ����� ������������������� ��� ���������������"�

������ ����� �������������# $��#����� �������������������������� �$�(����������� ���� �� �������������� ����"������ ���������������� ��������> ���� ��� ��� �� ��������������"�����������������������#�������������� ����������������������� ��� ��������� ����������"�

���������� ������ ��������������������������������������� ��� ������ �������(��������� ���������������������� ������� ��������"���������+��������������#�������(������������ �������$������������������������"���������������������� ������������������ �������#���� ��������������#������������������ �������������� ��������������"�

* #���������� ������������������ ��� ������������� �(�������������������� ��������������� �� ���������#���������� �������������������� ������� ����� ����H����������"�������� ������� �������������� ������� ����� ���������������������(�� ������������������������� � ������"�E> ��� ������"�7==4F�

������������������� �������������������������������� ����������� �# $� ��������#��������� ������� ��������������#����������� �������� ����������������� ����������"������ ��������������������� ��(������������ �������� � �(�������������������� ����������������� ���������� �������� �0��"������������������������������� �������������� ������������� ����+����������"�������+������ �������� ���"����������# ������+� ��������������� ��������������������"�� ���������� ����� ����������# ��������� ��������� �#������������� ����� (����#����� �����������#��������� �"�

�. ����������������������������������� ��������������� ���������������� �� �������"�������������� ���������� ������ ��������"�:����� ��������� �� ����������� ������������� ���������# ������$��������� ��������������������"�

����������#���� ����$�������� �������� �� ������������ ����������� ���� ������ #�������(�$� #�������������������"��������$������ ������� �$���������� ��������������� �����#�������� ������������

Page 10: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

6

���#��������$�������� ������� ����������� ������������� ������������������������"�

�������� �����������������������������������������#����������# $"�������� ������������������ ������������������������������� ���� �������� ������"�������������������#����������(���������� �������� ��������������������������������� ���������"��

��������� ������������������������������ ���������������������� ���������������$������� !(�� AB@%�@BB/�������� ���"�

3.3 Catia V5

������ !����������������3�����������������������������2���C��"����� ������� ������� ����������� ��� �� ����(������������� �# $� ���������������������� ������ ����� ��������"�

. �����+����� ����������������(�����������(������������(���������������������������� ����� �����#"�B������0 ���������� ��������H�� #��� ������� ����#������������������+���� �"������������#������� ����#��� #�#�������������� ���������� ��������������� ����#����� �������$�� ���� �# $������������#�������������������"����� ���������� �������# $����������� �� +�(��""�� ���������� ������ �����������������������#������� �$��� ������������� ���� ���� ���"��������� ��#�������� ��� ����������#������������� ������������������������ ��� ������������������"��

��� �0��������# $�� �(������������ �����������(������������������������ ������#������������� ���� �������� �����#�������� ��"�@#�������������������������������������������������������������������#������������ ��������� ��������"�

��� �0����������������������� ������������ ����������������#� ������������������������������ ���"�

������ !����� ��������������#���������������������"�

3.4 Features in Catia V5

���������������� !��������������� �0��������������������������������� �"���������������������������������(�#���������$�������������������KK������"��������������������������������$������������������ ����������� ��������"�

J������$��������������������� ��0�������� �0���������� ����������� �������������������������"�� �������������+���������������������������� � ���"������� � ���������������������������� ������#������������������� ������������ ������������"��������������������������������������������#����� ��������������� �������������������+� ��������������������������������"���������������������������� ��������(�#��������������������� �(������������������������������������� �������������������������� ��������������������"�

Page 11: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

7

��������������������������� ��� ������������� �����������(�������+�������������������������� ������������"����������������������������� ����������"�������������������������������� ���������"�

��������������������������� !����������#����#�����������#���������������������� �� �� �� ���������������������"�������������� ���� ���������#��������������� ��� �$���������������������� ����"�

������������ �� ������������ �����������#�������� �������������������������������������� �� ������ ����������� �������������� ������������� �� �������� �����#������������ !"�>���#���� ����������� !����������� �(���������������(�������������� ������������"������������������������������������������� ��������� �� ��#���������������������������� !����� ��� �� �������������� ���������������� ����"�

.����������������������� !�������� ���# ������ �����������������"�:������������� �������� ���������������������������������������� �0��"�������������+����� �������� �����������"������������� ������������������#��������������������� ���� �� �����+�����������"���������� ������������ ����������������"����+���������������(�#��������������������������� ����������������������������������"���������� !����������������������� �����������"������������������� ������� �� ������� �����������������"��

��������� ���������������� ���������������� ��������������������� ����#��������������������������$������ ������� ����������"�2�������������$���� �� ���������������������������������������� ���������� ��"������������������������������������������� �������������������"�' �+��������������� ����������������������������������������� ��������������������������������"�

��������� �� ������� ������#������(���������������(�#�������� #��� ���(��������������� ���������� ������"�� ������������������������������ ������� ��� ���������������������������"������������������������#���������������#��������� ���������� ������ ���������#����������"�����������0������$������������������I���������������� ��������������������������������� �������"�

��� ��� ���� �������������������������� �� ������� ��� �������������� � �������������� ��"���������� !������������������������"������������������� ����������� ��(���������� � ��������������������� #�������"���������+������ ��+������������ ������������������������� ������� ������ �����2:��������"�

���#������ �������� !�������� �����������LAA###"�����"� �"�

3.5 Component application architecture

' ����� ��������������������#� �������"����� ������� ������� ��� �����(�#������������������� �����������������"������ ����������������#���� ��#������������� ���� �.2�J��� #�� �� �?��+"������������������� ������� �# $� �� ������� ������� ��������� ��� ������������� ��"�

Page 12: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

8

������� ������� ����������������� � ���(������2����� � ������>����(� �� �����KK"����������������� � ������� ������ #��������KK����������������� ������������������ 0�������#����� ���������������"�

3.5.1 Object model

����������������� !������� �0���� ��������������+���� �� ��.2�:.I����������������� ����?��+���� �����#��"������ ���� ��2�� ���������� ��������� �� ��&��������� ��� ������ ��������������KKL�

• B���������� ����������� ���"�������KK����������������������������������� ��������(�������������������(���� ������� ��������������"�

• /���������+��������������KK�������� ��� ������� �������������������������(�#�����# ������$��������������� ������#��������� ������� !"�

• 2��� ��� � �0������������ ������ �����"���� ������ ��2���������������������� ����� ���� ���������������� ��� ������ ������� ������������������������ ������ �����"�

• '�+����+���� �� �� �0���"�����KK������� ��� �+���� �0������������������(������ ������������� ��� ������� ���������������������������������������������� �+����������� �����������������"�

���� ���� ���� �������2�� ������ ��������������� !�:�0���. ����:.�"�

����������������:.����CATBaseUnknown(�#������������� ��IUnknown�)�������������� ��.2�:."������������� ������������������������������ �� ��������������(�������������� ������������������������� $����"�

' ������������� ��� �������� �� ���������� �0���+� ������ ���������"����� �� ������� ������������� ���������������� �������������� ��������������������$�� +"�

�����������������������2������������������������� ��� �����������"�������� ����� ����� ����#���� ��������������� ������������� ��� ������� ���������������#����������������"������� ���$������ ������� ��2�� ����������������� ���#��� �������� ��������� �"����� �������������������������������������� ���� ����������� ����#�����#������ �������� !�#��� ��������"�

�������������������������KK������(��""�� ��������� ������������������ ��"����������������� ������� �������������� ����������B� �0������������������� +����#����������������������������� �"������B� �0�������������������������������������������� �������� ������� ���������������������"������B�������������� ������� �����������"�

' ������ �� ������� �����#�� #��������������� ��������$������� ��(�����������������������������������������������������"�:����� ������������������������� ��� ��������� ��������������������� �� �������������"�/�� ���� ���������������������������������������������������������������� ���� �� ����� ������������������������� ����+�������� �� ���"�

Page 13: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

9

������������� �������� ���� �� �������� �����+���� ��(������������� �������������A ������ ��� ����+������������"����+���� ������ �����������������������������(�#���������������� ��� ���������� ����+�������� ��� ���"������������������������������������ ���(�#������ �������������� ���������������� �0����������������������������� (�� ������������������+���� ��(����#��������� ���� �� ��#������������ ����������� ��� �������������� �"��

�������� ����$���������� !�������������#������������ �������#������������������������������"���������� !������������������������� �0�������� ��������������"������������������������������������������������������������ ������������� ���"��������$������ ������� ������� !�� ����$����������������������������� �����������������$������������ ���"����#��������������������������������������������� ������ ������������� ���"��

���:.���� ����� ��������� �� ���#��������� ��+������� ��(�� � �������������������� �0��� �������������"������� �(������������������� �0���� ���� ���� ��(������������������� ������������������� ����� ������� ��������#���#���������� �"��

3.5.2 Internal structure

������ !�������������� ������ ����. ��� �#�� �� �����������"�

���� ���������� ���� ���+������������������#�� ������������������������ ����"�

������� #��������� �� ����������� �������� ������������ � � �������� ���(�#������������������� �������� ����� �� �0����������� ����"����� �������� ��������������������� ���������������������� ����� ��"����������������� ������ �������� ������������#������������������������� ����(������������������������� ������"��������������� �� ������ � � ������� ���(�#�����# $��#����� � � ������� ���������������������������� ������ �������"�

:����� ����������������������� ���(�#��������������� ����������#��������������� ������������ ��� ��������������������� ��������"�

� ����� ���������������������# $������� � ������������� ��"����+��������������������������� � ���������������������������� ��������#�����"����� � ������������������������������������������������ ������"������� ��������������� �� �������������������������#�����������������������������"�

������������ �������� ����������������� ����������������������������"�������������� ������������������� ����������������������������� ����(�������&����������������� !"����������������+���(�#����������&���������������������������������� ��� �������������������� ����"�������&�������������������������������������������������� ���������������� ���&���������������$� ������������������������� ������������ ����������"��������$������ ������� �� �������������������������������������#�������� ������������� �� ���������� ������� ������������� �� ��������"����������������������������������������������#����������������� #������������������ ��������� ��� ���� �"�

Page 14: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

10

J��������������������������������� ���������#��������������� ��� ����������#� ��������"�

���������������������� �������������� !(�#�������������������������������������������������������������� ������"����������������� ���� �������������������(�� ����� ����������� ���� ��������������������������� ��� ��������������� ���� ����"���������� �������������������CATIBuild�������"������������ ������������������� ��Build()(�#�������������� ����������������� !"���

:��� �� ������������� ���������������������� ���(�#������ ����� �0��������������$�����(� ��(���"��������������� ����� ��������������������(�#������� �0���������������� �������� ��������#���������� ����� ������������"��

�����#�� ������� ����#��� #�#���������� �� ��������������� ����#����������������� ���� �� ���� ������"���������� !������������ �?��+����#������J��� #�(��������� ������������ �������������� ��#������� ����#�����������������#"�

���� �� ������������ !������������� �������#����������� ��#�������(��""����� �� ������������������������� ���"���������� ������ �������������������� ����������� ������#�������� ��� �������������� �������#���� �0������������������� ������"������������� �� �0���� ������������� ���� ������� �"�������� �����(����� ����������(�� ������ �� #����� "����������� ������������������������ ����������� ������������ ���� ��� ���$������������ ����������� �������������� ���������"�

���� �� ��������� ��� ������� ��������������������(�#������������������������������������ ���(�� ����� ������"�

3.5.3 Document organisation

������������ ����������� �����"����������������� ������������������� ��� ���������� ������� ����"����������� ����������������� ����������� �������#������������� ����������� �������������� �"���������� 0������# $��������� ����� �������������� ������ �������������� !(���� � ������ ��� �������#��������������"�

Page 15: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

11

3.5.3.1 The part document

������� ������������������� ��� ������L�

• ���� ������ �����(�#������ ������������������#��������������������������� ����"�

• ������������� ��� �����"����� ���������������������������������$������������������������������ ���� � �0����������� �����"������� ������� �����# ������ �������(��������������������� ������������"����������������������������(��""��������������(��������� ����������������������������������"����� ������������������������������ ���� � � �����������"�

• ���� �������� �����"������� �������� � � ����������� ������ ��������������������$����������"�

• ����� ��� ������� ������������ �� ������������� ��"������� ������� ��������� ����������� ���������������� �� ������(��������������"�������� ����������������� �������������������������� �"�

��������� �� ������� ������#������������� �������� �� ������������ ��������������"�

3.5.3.2 The product document

��� ������ �������������� ���������� �0������������������������������������"����� ���������������� �� ������ �������������������������$�������������� ����"���������� ��+����� �� ���������������� ���� ���� ����"��������������� ����(���$�����(�� ������� ��&�������#������������ �������������� ������������ �������������� �� ������������"��������������������� ������� �� ������������ ����"�������������� �� ����� ����� �������������������"���������#��������������� ���������� ��������� #��� ������(�#������������������� ������ �����"�

���� ������������������� ������ ��������� �������#������� ������ ������� ��������� �� ����� ������������ ��� ���������"����� �� ����� ������� ���������������� ������(�������(����������������� �����"���� ��� ������������������������� ������������� �������� �� ��������"�

�������� ��#���������� ��#������ �� ���������������� ����������������������������������#����� ������� ���������� �����#� ��������"�

3.5.4 Types, names and coding rules

���������������� �� ������(�� ����������������������������������� �0�����������$�������� ������� �0������������ ����� ���������#"���������#�����������������������������������#��"�

2���������������������(�#������������������������������� ������������� �����������"���������������������������������+�����������CATDocument"������������������#����������+�� �� #�����������������������CATIContainer"�

Page 16: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

12

����������� ���� �� #������� ����� ������ ��������(�#������� �������� �������������� #�����+�� ��� �������������"�

�2����� ��������� ����������(��������(�����������������(�� ����������������������������� ��������������������� ��+���� ��"�

3.5.5 Code structure

�������������������;9����# $����� �������� !/<(�#���������� �� ����� �� �������������� ���������������� !� �� �������������������� �"�B��������# $�� ������� ������� ���������(�������(��� ���������� ��(������� ���������� �"�

� ����� ��� �������������# $�������������� �� ��� ��� �����#������ ������ ����"����������������������������������� ������������ ��#������������������&���"��������� ���������������������� ��L�� ����������� �������� �� ������# $��)���������������(�� ��� ��������������� ��������������# $�)�������������������� ����������� ���������������������� ����)�� �����������"�

������������������ ���� ��� �������������� ��� ���������#����������� ������ ������������#����# $�"�

��������� ������ �$������������#���������������������� ������������� ���� ����������+�������� ������������������� ���������������� ������������ ���� ��� ����$���"��

3.5.6 Build issues

��� ��� �������������������������� ���� �������� ������#�������# $��� ������� �� ��� ����$�#���"��������# $���� ������������������������������������� �����# $����"�' ������ �������+��������������������� �"��#�������� ������� ����������� ����(�� ��#��������� ��������������"�

3.5.7 Development tools

' ����.�� � ���J��� #�H���� ������2�� ������ ������ ������ �� ���������������� �������� ��������B�� �������KK�8"="� �������KK���������������� ��.�� � �������B������ ������2���� �� 2�"�������� �������� ���������� ������ ������B�� ���������������������������(����#�������������# $������� ����"��������� �����������$��������������� ������������ ������B"��

�������������# $��#���������������#�&��$�"�������+����L�#�������������#���������� 2������������+���� ������� 0������� �� 2������� ���"������������������� 2������(��������������� �� �� 2���������2� �������� ������������������ ��� 0�������� �����#�� $���B�������� ���������#�������� �� ������� 0���� �������#������������ ��� 0����������������������� 2������� ������� 0������"��������� ��������� �������������������� $������������� ������� ��#���)�������������������������� �� ����� ����� ������ ����"�J��(�� ��������#������������ 0�������� �� 2��������(���������� �������� �������"�

Page 17: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

13

��%?�������������� �� ����"��/�������������������������� !������� �������� ��� ����(�#���������������������� ��� ������� ����������������#��������������� �.2�J��� #���

3.5.8 Running an application

������� �����# ��������� ������#������ ������������� ��"���������������� ��#������� ���������� $��� ������ ���������"����������������� ����������#��� ���������� ���������� !����������"������� ������ ��� ����������������� �������� �0������$������ ����������������(�#����������������������� ������������� �"���������� ��������� �����#������ �#�������� �"�

��� ���#���� ����� ��������� ��#������������ !������(����������������� �"����#���� ������������������������������������� ��� ��� ������� !�� ������(�#��������������� ������� ������������������ ��������������#��� #���������"������������� ������� ���������� ���������� ���������"�

Page 18: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

14

4 About API-development

������������������������������������������������ ����(������������ �����������������+��������������� �������� ����"��������� ��� ��#������������� ����� �������������#����#�������� ����������� �����������"�

� �#������ ���������� ���������������� ��������� �������������� ��� ���������������(����#��������� ���������������� ������������� ����� �#������������#����� ������������ ���"��������������������������� �������$� #�#���� ���� ������������� ���������������������������� ����������� ���#�����#����������� ����"�' �������������� ����������� �������������������������#���$� #�"�� ������������� �� ���������$����������������"�#�������� ��+������ ������������ ���� ���������� ���������� �+����"�:�� ���������������������������������(�#�������� ���� �����#��� #������� �� ������������������������ ��������"������� #����������������#���������%?������(�#��������� ������������ ���������������������������������������������� ���������� ��� �"�' �%?������������������������������������������������������ �� ������ �� ������ ���������������� �����������#��������������� �"�

������������������������������������� ���������������������� ���� ����������������� ��#�������� ���� ���� �����������������������"������&����� ��$� #���� ������������������������ �������� ����� ��������� ������������������� �(����#���������������� �������������������������� ����������������� ����� ���������������������� ���������������������� ����#����������� ���� ������:.����� � ����������� ������ ���� ������"�

��������� ������������������ ���������������������� ���������� �"�������� ��������������������������� ��������������� �� ��������� ������������ �������������"�������������������� �� ��+��������������������� ������� �������������#�� ������ ���� �"����� ������ ��� ����#����������������� ��� ����� �#���� �#�������������#���������� �������������������(������� ������������� ����������� ���+�������"�

>�����������0��� ����������������&������������������ ��� ��+��������� ���# $�� ��������� �"���� ���� �������������� �������G���E4<<;F�����.�����E4<<<F(�#���������#������� ����� �� ������� !�)�� AB@%�@BB/"�

2 ������������ ������ �����������#��� �����(����������� ���������������$���������������������� ������# $������ ��� ����������������� AB@%�@BB/����#���������������L��

• ���� ������� �� AB@%�@BB/(�#���������������������� ������������������ ������� !(������������� ��������"������������������� ���������������#���������� ���������������� ���� ��������������"�

• B���� ����� ������������� ��� ������ �������� �� ���������&���$���� #����� �����0 ����$"������������������������������������� ��������� �������������� ��������&���$���� #����� ���+���"�>������������������ ���������# $����� ����������� ��� ��������� ��� ������"�����

Page 19: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

15

������ ����#�������# ��������(�#�������� ���������� ������������ ��������#����������������� ���"�

• �������������� �# $� ��� ��� � �����#������������� ������������)�� ������������������� �� �#���������������� ������#� ����������� �����0����� ��� �����"�

����������������������� ����# $����� ����������� ������������#������������(� �#���������� ����������� �� �#����������"���� � ������ ��������������� �#����+�������"����������� $����� ����� ����������� ���������� ������#������������ #�� ���$��������������� ����������� ��"���������� ����������� ���� ���#�������������������� ���� �������� ���"�������������# $��� ������� ������� ��� ���� ��#������������� ����� ��(���� ��#�����������������������$�������������# $�������������� ������ ������� ���� ����$�������� �������"������������������� ��������#����$���� ����������� ���#������#���������#����$���� ��� ����������������������� ����� ��"�?�� �����������#���� ��� ������� �����������������#������� ���������� ��+�� ������������"�

Page 20: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

16

5 Analysis of the problem domain

��������������������������������������������������������� ������ ��������������������� ��"��

5.1 Common programming tasks

���� ��������� ���#�������������� ��� ����� ���������������� �� �������������+� ������������������� ����� �� #���������L������#�������� ���������������(���������� �� ������������������������(�+������QueryInterface������ ������ �� ����� �������������"��

:������������������� ������������ �� ��� ���"����+����������� ���������(�����#��������� ����� ��"�J����� ��� ������� ����� �� ��� ��"�2 ���������+�����������������#������� ���� �����������������"������� ����� ����� ��� ������#�������# $����� ��������� ������ ���� ���"�

� ���������� ���� �� ����� �# $�#���(�� ������ �� �� #�������������������� ��� �����"�M ����� �������� ������������ �������� ����� ��� ������+�������������(�� �� ������� ��������� ���� ����������������������� �� ����"�

��������������������� �������������������� ����������������������������� ������������� ���������������� �"�����"��

����������+��������� #�� ������������ ��������� �����(�#�������� ��� #�������� ��� ����������� �������#�������� ������#��"��� ���������� �� ������������ ������Release()� ������������� ������ ����� �� �����"���������� ��� ���������������������� �� ��������CATISpecObject_var��� #"�������������������_var��������� ������ ������������(�������� ����� ���������������������������� ��� �����"�������������� ��������� ���������������� �� �0��"� CATDocument* theDoc = 0; CATDocumentServices::OpenDocument(filename, theDoc); CATInit *pDocAsInit = 0; theDoc->QueryInterface(IID_CATInit, (void**)&pDocAsInit); CATIPrtContainer *pSpecContainer = (CATIPrtContainer*) pDocAsInit->GetRootContainer("CATIPrtContainer"); pDocAsInit->Release(); CATISpecObject_var ospPart = pSpecContainer->GetPart(); pSpecContainer->Release(); Use ospPart.

������������������$�������������� ������� ������������������������������������������� �� ������� �(� ���������������#������������� �� ����$� #����#����� ������� ����# $���"������������������ ���������� ����$�������� ��������������"�

Page 21: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

17

������������� ����������������� �� ���������������# ���� ��������� �������������������� �������������������� ������#��"�

�����#���$���� ��� ��������� ��+��������#���������������������������� ������� ����������� �������������������������� ���������� ����"�

��� �����������# �������������� �� ������� ������#� ����� �0��������� ���������� ����� ����"�' ������������� ����� �����# ����������� ������� �� �0���#������������������� �(�������� ����������������������� ������ �������� �����#� ������ �� ���"�

������� ������� ������������� �0��������������� ��������� �������������������"�������������������� ������� �������������#���������� #����� ��(��������� ����"��������������������� ������������(������#��������������������� ������"�

�:.�# ���� ����������� �������� ��� ���� ����������������"������������������� ��� ���������������������� �#��� ��$� #����#���� �0��������� �������������������� ������������� ���"�������� ������������������������ ����� ������������������������ ����� �������� �0��"���� �� ������������������� ���������� ���I��������� ������������� ���������������������������������:.�� �� ����"��������(�#�������������#�� ����� ����������������� ������������� �����������#���� ����� ��#�������� �������������� ����������������� ������ ������ ������"�

������������������ �������(�������������� ������������ ����� ���������(������� �������������������������� ������� �������� ����� ���������� �"�

:��#���� ������������ ��������������������� �#������� �������������������������� ������ �������������������������� ��� ��������������� �����#��������������������� �������������� �"�

��� ������� �� �������# ��������������� �0�������������� ������������ �������������#����������� ���������� ����������$����� �������� �0��������"�

5.2 Application specific objects

���� ������ ��� ������������� �0����� ������������� ������������� ���� ��������������� ������������ ��� �+������������������������ ������� ��������������$� #�� #"�

��������� ����� �$������������������������������������ ��������������������� ���� �"�

� �+������������� ��������� !������������������� ����� ��#����������������� ����������(�����#��������������������#���$�"�

�����������#����� $�������� ���������� ���� �+���� ������#�������"����+���� ������� � ����� ������������������������������� ����� ����������������� ���������� ����� ���(��# ��������#����� �+�������� ���#������������������"�

Page 22: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

18

������� ������� ������#�����������������#���L�

• �������������� ��+������������"�

• >�������� ��� �����+��������2�����"�

• >������ �� �����#���������������� ��������"�

• >������ �� ���������+���� ����������� ������������ �����+������������������������������������ ��"�

5.2.1 User feature

����������+������������������������#��������"��������� ����������������������������������#������� ����������������������������"�

�����������������������������������#����� �0������� ������������� ������ �������������#�����������#����(�������(������������� ����������������"����������������� ������������������������� ��"�

�������� �������������� ����������� !�������������� �"�

5.2.2 Derived feature

J�������������#���������������� ��� �����2������� ��������������������������� ������ ����������������������� ������ ���"�� ��������������������� ��� �����#��������������� ��������� ���������� ������������������������������� !"�

����������� �������������� �� ����������CATINavigateObject�������(�#������� ������������������������������ ��� �������� ��� ���$��������������� ��������������������� ���"�:��#���������������������������������� �������� ��� ��"����������� ����������������������� ���#���������H��������������� ������� ��������� ���������� ������������� ����"�

��������������� ����������#������������������������������������ ������� ��������������������������� ��CATIVisu� ���������"��

��� ��� ���$���������������������������� ��� ������������������CATIEdit�������"�

���CATIBuild�������������������� ��� ���$�������������������# $(� ��#�����������#����� ����� ������������������� ���"�

� ���������(�� ��(�������������� ���� ���CATICSOFilter������ ��������������������������� ��� �"�

J�������������������� � ������������� ������#����������������#���� ���������� ������������� ��� ���������������� ��� #������������������"������������#����������������������� ����������������������������������������������� ������������"��

5.2.3 User defined feature without derivation

���������������(�#�������������#��� ��������� ����������� ��������� ��������"����� ��� ��������� ������������������������������� ����

Page 23: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

19

������������������������������������ �����"�������� #��� ������� �� �������������� �������������������������������"�

2�������� ����������� ���������������������� ��� ��������������������������� ��"��

�������������� ������ �������� �� ������������������� �"�

������������������������������� �������$���� ���������� �������������"����������������������������� �(� ���������������� ��� ������ ����������(���������#����� ������$����� ���� �������������������� !"�

5.2.4 Feature extension

�������+���� ������������� ������������������� ��� ����+�����������"����+���� ������������ ����������� ���"��

���+���� ����������� �������������������������������� ���������������"�>�������������������+���� �������������������������� �������������������������+���� �� ���� ����+��������������+����������#������� ��������������������� �� ����������� �����+���� ���������+���� �������� �"�������� ������� ������� ���� �����+����������� �����������������������������������+���� �"�

@������� ����������������� ������������ ��������#������������(������������ ��� ������� �����������+���� ����������������������"�

������ !�#������� ��������+���� ����������������� ������ ����������"�

5.3 Applicative feature strategy

J����� ��������������� ���������� ����������� ������ ���������������� �� �������#������(��""�#����$���� ��$� #��������#��������� ��������"�����#�������� ����������� ���� ������� ����� ����� �(�� �������#����� ������� ��� ������� ����"������� ���� �������������������������������� ����������� ��������������������� �$���������������������� ���������� ���� ��������� ��������������#����+����������"�

2 ���������� ������ ������������������������ ���������� ����������������������� ������������� ������������ ���� �� ������ �����(� �� ������(���������������������������#������ �������������������������� ���� �"�

�������������� ������������������ ���� �������� ���������������&����������"�:�������������������������������#����� ���������� ����������������$����(���������"��������� ���� ��� ����������� �� ������ ����������I��������������������� ��������� �������������������������������������� �������������� ������ �����"�

:��������������������������������� ������)�� ���� ������������������������������)�� ����������� �� �������������#������� ������������"�

�������(���������������� ������� ������� ������������������������������������� !(�������� ����� ������ �������� �� ��������� ���

Page 24: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

20

������������ ������������"���� �������� ���������� ���������� ��������� ������� �����?��'���� ������� ��� ���2�'�����

�� ������ ������ ������ ������������������������� �������������������������������������� �������������������������� ����������"��������$������#$#���� ������������ ������"�

������������� ��� ��� ������� ������������������������������N� ��������O��������������� ���������+���� ��"�

������� ����������������������I�� ��������������������� ���������������� ���� �������������������� �"�@��������������� ��������������� ��������������������� �������(����N� ��������O������������������������������ �� �����������������������������������+���� ���������������������������"�

��������������������������� �������������������$����� ���� ����������������� ����#������������+���� ������ �"�

�����������������������������(�� �������������������������������������� �������� ������������������������������������� ������� ������ ����������������#���������������������������������(������������������ #������� �"�

��������������# ������� ���� ������� ������������������ ���������� �������������� ��������������������# �����������������+��������# ������� �� ������������������� ���2�#� �� ������� ������������������� ����������������������� ����������� �$�������������� ��� ���� ������������� ������"�

� ��������������������������#���� �������������������������� ������������N� ��������O������"�

Page 25: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

21

6 The API

��� ��� �#����������� ������������������� ����������� �"�

J����������� ��������������#����� ������������ ��#����������P����#���� ����$�# $����#������#���� �����������#��� ���������������� ��� �����$������� �� ��������� ��� $�� ���������������� ���� ����������� ��"����#���� ������� ������������������ ���� ������������� ����� �������������#���������)��������� �����"�J����#������������������#������ ������� �������������#����� ��� ��+�����"�>��������� ��� ��� ��������������������"�������$������������������� ����������+��������������� ����������������� ���� �"�:�� ��� ����� ������������������ �����������"������� �������������������� �����2������������������ ��� ������#������#�� �����#��� ������� ���"�:��#������#����������� ���������� ���������������+��������(��""������������� "������#������� #�#���� �# $����������������#���� ��� ������� ������ ������������ ��#�������������������� �� �#����������"�

������������ ���� ����"������ ����������� �+����#���������� ����������"������������ ���� ������� �����������������#�������(������� ��#���# �������������� ���$���������"������ ������������������������� ����������������� �������������������� ����#��"�� ����#�����&�����������������#�������������# $���� ������ ��������������"���������� ������� ���������������������������������������(��������$�������� ������� ���������� ����� ���� �����������������# $��������� ������� �������������������� �����������"��������� ����#����� �����������������#���� ���� ������������������������#������������"�� ���$��������������� ������������������� ������ ���� ���������� ������������ ��������(�#������ ���������$����� ������� ����� ���"�

��������#���������� �� ��� ������"������ �������������������������� ������������ ������� ����������������� ��� ������� 0���#��� ���� ����"�>�����������������������������(�� ���������� �� �������������������� ��������� � ����������������������� ��� #�� �������� ������"��������� ��� #���������������������� �������� ��������� ��������"����������������������+������� ���(�#�������������������������#���� ����������"�.�������������������� P�:����� ���������������������������������2�G���������������� ������������� ����� ������������������� 0�����$������� �#���� ���������P�

�������� ��#�������� �������� �������� ��2�G(����������#���� ���������������#�������� �������������#���� ������"�* #�����#�� ������������"����� ����#��� ��������2�G�� ����������� ������������ ���������������������������� ��#����� ������� ������� ��������������������������������������������������������� ����&����������������� ������ ��������$�std::����������������������������$����� ��� ������������#������ ������� �������� ��� ����$�� ���"�������� ��������2����� ��������� ������������ ������������ ��� �����������������������#��"�

Page 26: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

22

@+�����#���� ����������������������������������� �������#��� ���������������������������(��""���� ������������������#����"�"����������� ���� �� ������� �����+����� � �"�@ �����������)�� �� ����� ���������������������������������� ��������&����� �� �����"����2�G������� ������#������������������"���� ����� ����� ������������ ��� ������� 0������������ �)������������#�������������$�������# �������������� ���������� ��"�

6.1 Initial design, global functions and classes

J�������������������������������������� ��� ���#���������� ��������������#���� ��"������&���� ������������������# $����#��"���������������$�����Q��� ��� �� �����(����������� ��� ������������������������������+���� ����������� ������������ ����������� �"��������������������� ����������� �������� ������� �0�����������$����� ������� �#��������������������� ���#��� ����������������������� �����"���������������������� ��# ����� ��������������� ������ �����"���� ����������� �������������� �0����� �������� �� ��� ����(��� #���������������� ������� ��������������������������� �������������������������� ������"���� �� ���������#��������� �#�������������������� ������ �"�� �������������#���� ��������������������� ������ �������� ��������� ���� ���������������#���������������� ��������#������#�����������# $� �������������"����#������� ���� ������� �� ������ ��� ������������������������������������� ��� ������ ��������������������������� �������#������"���

���������������� �� ���������#���������� !�#�������� �������������� ���������� ���������� ������� �0���"������������#����� ��������� ����������� �+� ����������� ����������� !�������� � ������������� ��"�>���������������� ���� �0������# �������������� #���� �� ������������� ����� ������������� ���������"����� �0�����������#������ ������� ����� �������� �0��"�.� ����������� ������� ���������������������� ������ ������������ �� ����������������"�

������ ������� ���� ���������� ���#��#������ ����� ��� ������������ �� ����(� ��������� ��������� ������ �� ���(��������� ������"���������� ���# $�������#��� �������������������HRESULT�������������������� ������� ���������(�#��������������������������� �������� ������������������������������������ �������� �������� ���"�������������������� �� ��� ������ ����&�����������(� �#������ ������������ �������� ����"���������������������������� ���������$���� ���� ������������ ������ ����(��""������������� ��� ������������������������ �AddRef()�����Release()"�

���������# $�#��������� �� ������� �(����������>�����"������������# $��# �� �����#������(� ��� �� ����������������������� ��(���������>��(����� ��� �� ���� ��� �������������� ������(���������>�����"�

�������������������>���������� ����������# $���������������������������� ����� ������������� �������>������� �����������������������������$�������������"��������� ������ ���������������� ��� ���������������������+����������"�

Page 27: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

23

������� ����������>������#���+�����#����DCBapUdf(����������������� ����������������� ��#�����������������������������#����������������� ����������� ������������������"������������������������������������������������� ������������������������������"���� ��� ����������������(���������������#������� �����������������"��������������������������� �� ������������������ ������������������� ��"����#����� ����������������������� �� ���� ��������� ������������(��""�����(������� ��������"�������������� ��� ��# $�� ��������(����������� ��� ������� � �� ��� ������������"���� ������ ��� ���������#�������"�

6.2 Applicative feature handling in the API

���������� �������������������������������� �� ������������������(���� ���� ������������������������� ����#���������"�

�������� �������� ���#���� L�

• ��������� ����

• �������������

• � �� ������ ���������������� ����������������� ������� �� ����������������������"�

• �����������������������������������������

:��������� �������������(� ��������� �����#���������������� ������������������� ��������� ��������������������������������#�#����"�

���������� ���������(�DCBapApplicativeUdfSU(����� ��������������������������������������� ������������� �����#��������������� ����������"����&������������������A ��A����������� ������ ��"������� �� ��������������� �������� ������������������ ������#���������(�������������� ����������������� ��������������� ��"���������� �������������#��� ��������������������� ������������� ����������"��

���������� ������������� �����������������$����� ����������������� ����� ������ I�������������� �������� ������# ����������������������� �����"�������� ������� �������������������������������� ��������� �0�����������������#���������������� ������� ���"��������� ������� �������+��������#������ ���������"����������������� ���� ������#��������������������� �����+������� ���� �������"�

���������� ��� ������������������������������DCBapApplicativeUdf�#�������"����������� ���� �����������������������������$���������������#����������� ��� �������� ����������� ���������"�

��� ��� ������������������������ ���������������DCBapApplicativeUdf� �0��(�#�����#����������DCBapUdfAttribute�)����������������������������� ���������"�' ��������DCBapUdfAttribute’s����������� ������������"�

Page 28: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

24

���������������������������#������� ����>������������ �������� ����#��������� �������# $�� �����������"�

Page 29: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

25

7 Result and conclusions

��������������������������� ����������������(���������� � ������� ������������# $������� ����������� �����"�

� ����������������>������� ������ ������������ ��������� ���"����� �������� ��>�������� ������� ����������"�

����������������������� �������� !������������������������� ��DCBapResult"��������������� #���� �+���������������#������� ���� ������������������ ����� ����������������� ��"���� ����������������������������������� ��#������������� ���+� ���� �#����� ���"�

������� ������� ���������������������������"�� ������������� ������������ ����������������������� ������� ����������������"������������������� #��� ��� �������������������"�������� ������������ ����#����(� ���������������������(��������������������"���������� ���������������� �������������������������(�������� ������������� ���������� ���������������� �������� ��������� ������ ����������������� ����� ���"�������� ����� ������������������������������������ ���� ����"�:�������#�������������#���(�� ��� #�#�������� �����(���� ����# �������������� �#����� ���"�

�������� �������������������� ��������#��������������������������������������"������ ���������������������������"����� ������������ ����������������������� ������� ��������������������� �������� ����"���������� ���������������������������������������������������������� ����������������"�

7.1 Some suggestions

2 ��������� ��� ���� ������� �����������"����#� ���������� ����������������������� ��#���������� �"���������������������� !���������#���� ������������ ��������� ������ ������� ��������� ��� ���������� �"�������#�������������� �������������� ����� �����(�� ������ ����������� ���������"������+���� �������������� �� "�

����������+������# ��������������������������� ���������������#���������� �������� ��# $����������� �� +�"�� ������������%?��#���������������������� �������"�

��� �� ������# $�# ������� ��������#���������������������������� �����#����� ������# ��������������� ����������"�������� �� ������������ �� ���#�������#������� ����#���# $������������� ������"�2 �� ������#����������� ����� ���������������������������#������� ����������������� �������� ����������������������� �� ��������������������������������������������������� ������ #(����������������� ��+����� ����������������� �� ��������"��

���# ������� ������������� �+�����#����������� ��� ����������������������� ������������������� !������� ���������������������������� ��"��������������������# ����������� �� ����� ����������������������������

Page 30: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

26

CATINavigate��������� ���$�������������������� ����#������������������� ���"��������������������� �� ��CATIEdit�������� ���� ������� �� �������J�D������ �������KK�������������� #��� ��������������$"������� ���������#����������������������������(����������������������� ������� �# ������� ������ ��������"�

:����������(���$���� ���� ����������������������������� ���� �������������� ������� ��� ������ ����������"�������������#��������� ������� ������������������� ��������������������������� �����������������(�������������������#���� ����������������� �� ���������������� ������#��"���� ��� ������������� ������������������������ ���������������� ��� �������������#����������"����������� ��������������������������������������� ����#������������� �������������������� ��������%?������ ��������������#���������������������������"�

Page 31: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

27

Bibliography

>�������'"�����"�7==="��� �������������� ������������������������������������� ������� !�"������������E ����F"���������L�<http://www.sei.cmu.edu/publications/documents/00.reports/00tr008.html> (2004-04-11)

> ��� ��J'�����"�7==4"�B����������� ��������������� ������"���L�����R(�G��J(�����M��5����"�(�#�������� ���$%&'�������"(()!���*��������������� �����������������������$�����%��� �������������'�������������� �����������������������J ��������������� � ��� �(�>�0���(����8�4!"�

B������5����>����7"4�)�'���������E ����F"���������L�<http://java.sun.com/products/ejb/docs.html> (2004-04-11)

G���4<<;"�������� �� ���������� ����#�� �������������� ���+������$%�������#��&�,'�,��-"�2������������ 0��(�%����.��� �?������,����������4<<;"�

.�����4<<<"�.��/����/���������� �� �������#��&�,'�,��-�������� 0��� ��+���������1 ���2�"�2������������ 0��(�%����.��� �?������,����������4<<<�

.�� � ����:.�2��������� ��4<<!�E ����F"���������L�<http://www.microsoft.com/com/resources/comdocs.asp> (2004-04-11)

��� ���/"�7==3������������������3�� �����������E ����F"���������L�<http://www.martinfowler.com/ieeeSoftware/componentChaos.pdf> (2004-04-11)

Page 32: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

28

Appendix A

A.1 Syllabus

�/��$�������������"��������� �����"�

������������� ��� ����������"������ ��� ���� �������� ������������������� �"�

����� �� ������������� ����������"����� �� �������# $�������������� !"�

����� ���������������"�������#����������� ����� ����������"�

��0�� �����������������"���������������������� �� ���������#����������� ����� ����������"�

��1�� ����������������������"�'��� ����� ���� ��#����������� ����� ����������"�

�21�� �� ���� �0���� ��"���� ��#���������������� ������ ����� ��� �� ����"�

������������������$�������"�:�0���� ��#��������������$��� �������������� ����������(���� �� ���� �����������$����#�������$����������� ��������"��

�3����������2���C��"����� ��������� ����������"�

/���%�����������������"������������� ������� ������������� �"�

��0������������ �������� ����"�2 ��#��� �����������������#� ������ �������� �� �������"�@ ���������� ���������(�� �������(����������������� ��� �� ���� ����� ���������� �����"�

��4��������������� ���������"������������ ������������ �"����������:.%"�

�32�������� ���� �������� ��� ���������D��� �"���� �������� ������������������ ������������D��� ��� ��������������@2����������"�

13�.�� � ��"����� �����"�

13�21�� �� ���� �0���� ������������.�� � ��"�

21�:�0���� ���"���� �0���� �������������"�

21/�:�0������������� ��"���� ��� ���� �������� ��# $���� �� ����������������������G������ ��"�

23�:������������"�

+���/� ��� ��������"�������������������� #�� ������� ������������������ ������������ �����������������"�

3!4�2�������������������"���������#� �������� �����������������������KK��������"�� �������� ��������� ����� ���������"�

�3� ����������� "������B�� ��.�� � ��(�� ��������� �������KK"�

Page 33: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

29

Appendix B

�����������+�� �������������������� �� ������������ ���������������������$����������"��

B.1 Global functions in the API

��������� ���������� ���������HRESULT"���������������#�������������������� �� �"��������������� ������#���������$��#���� �� �������� ��FAILED(HRESULT)� �SUCCEEDED(HRESULT)"�������������������.�� � �����������"�

����������������������� � ������������ ������������������������ ��������"�� ������������ ������������������ ��������������������������+��#��������(�������������������� ����������������+��#������� �� � �����"�

DCBapAccessCatalog HRESULT DCBapAccessCatalog(CATUnicodeString* iCatalogName,

CATUnicodeString* iClientID, CATIContainer* iContainer, CATICatalog** oCatalog)

�������������� ���� ��������������������"�

���������5iCatalogName

����� ���������� ���� ������"�:��������������#����+���� ���� ����������"��������� ����� ������� ��������WorkSpace\intel_a\resources\graphic

iClientID ������������ ������� ��������� ��"�

iContainer � ���������#�����������������#�����������������"�

oCatalog ��� ��������� ��"�

+�����52S:T����� � ��#��� ����"�

DCBapCreateCatalog HRESULT DCBapCreateCatalog(CATUnicodeString* iStorageName, CATUnicodeString* iClientID, CATICatalog** oCatalog) ��������#������ �"�

���������5iStorageName

������� ���������� ��"�'��������������������#��� ���+���� ���� ����������"�

iClientID

Page 34: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

30

������������� ���� �����#������������ ��"�oCatalog

������������� ��"�

+�����52S:T����� � ��#��� ����"�

DCBapOpenCatalog HRESULT DCBapOpenCatalog(CATUnicodeString* iCatalogName, CATUnicodeString* iClientID, CATICatalog** oCatalog)

:����������� ��"�

���������5iCatalogName

������� ���������� ��(� �����������#����+���� �"��������� ����� ������� ��������WorkSpace\intel_a\resources\graphic\�

iClientID

�������� �������� �����������$oCatalog

��� ��������� ��"�

+�����52S:T����� � ��#��� ����"��

DCBapGetPart HRESULT DCBapGetPArt(CATDocument* iDoc, CATISpecObject_var& oPart) /������������� ��������� �����"�

���������5iDoc

�������� �����"�oPart

������"�

+�����5

2S:T����� � ��#��� ����"�

DCBapGetRootContainer HRESULT DCBapGetRootContainer(CATDocument* iDoc, CATIContainer** oRoot) /�������� ��� ������ ����� �����"�

���������5iDoc

���� �����"�oRoot

Page 35: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

31

��� ��� �����"�

+�����5

2S:T����� � ��#��� ����"�

DCBapGetRootProduct HRESULT DCBapGetRootProduct(CATDocument* iDoc, CATIProduct** oProduct) ������ �� ������������� ������ ������� ��� ������ ����$� #��� ������ �����"�

���������5iDoc

��� ����� �������� ������ �����"��oProdOnRoot

��� ��� ����"��

+�����5

2S:T����� � ��#���� ����"��

DCBapGetUdfList HRESULT DCBapGetUdfList(CATDocument* iDoc, CATLISTV(CATBaseUnknown_var)* oList, char* iInterfaceFilter = “CATIUdfFeatureInstance”) /������������ ������������������������������ �����"�

���������5iDoc

���� ������� �����"�oList

��������� ������#�������L�"�iInterfaceFilter

����������� ������ �(���������������?��'����������"�

+�����52S:T����� � ��#��� ����"�

DCBapGetUdfListFromPart HRESULT DCBapGetUdfListFromPart(CATDocument* iDoc, CATLISTV(CATBaseUnknown_var)oList, char* iInterfaceFilter = “CATIUdfFeatureInstance”) /������������ ���������������������������������� �����"�

���������5iDoc

���� ������� �����"�oList

��������� ������#�������L�"�iInterfaceFilter

Page 36: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

32

����������� ������ �(���������������?��'����������"�

+�����5

2S:T����� � ��#��� ����"�

B.2 Classes in the API

DCBapApplicativeContainer

Class to represent a DC-specific applicative container. It is also intended to automate retrieval and creation of the applicative container in the document as well as providing a simple access point to the DC-specific applicative udf:s.

�����������

public DCBapApplicativeContainer(CATDocument* iDoc) ���� ������ �#����������������� �0���#������������������������������ ������������� �����"�

���� ������������������������ ������+������������ ���������#������� ������#����������"������� ����������������������� �����"�

��������5iDoc

���� ������� ������� ������������������ ������ (������������ ������� ������+������������ �����(����� ������� ��������#���������������� ��������"�

���� ��

public CATIContainer* GetContainer() /�������������������� �����"�

+�����5

��������������� ������ �@?GG� �� "�

public DCBapApplicativeUdf* addApplicativeUdf(CATIUnicodeString* udfType, CATIUnicodeString* givenName, CATIUnicodeString* catalogName, CATIUnicodeString* clientId) ����������������������������� ���������������������� ���� ���������������� �����"�

���������5udfType

���� ������� ����"�givenName

�������������������������#����������"�catalogName

������� ���������� ���� ����������������"���������� ���� ����� ������ ���������� ������#����+���� �"��������� ����� ������� ��������WorkSpace\intel_a\resources\graphic"�

clientId

Page 37: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

33

��������������� ������#������������ �"�

+�����5

����������������������� �@?GG� �� "�

public vector<DCBapApplicativeUdf*> getApplicativeUdfs(const char* id) /����������������������L��� ����� �0��"�

��������5id

��������� ������#���������������������L�"�

+�����5

����� �#����������L�"�

DCBapApplicativeUdf

������� ���������������������������������"�

������������

@ ������������� ����� �������� ���������� ������ ������(����������������� ����������>������������� ������#�������������� �#������������������������������ ���"����������'������������� �����>��?�$� #�U��?���V�@?GG��

�������� ������ "��

��������iUdf

���#�� ����� �������������"�

public DCBapApplicativeUdf(DCBapApplicativeUdf& iRhs) � ���� ������ "�

��������iRhs

�����>������������?���� �� ��"�

������������������

���������>������������?��W��������V���>������������?��W��/����

��������iRhs

�����>������������?���� �������"�

+�����

�������������>������������?��"�

���� �

public void setGeoFather(CATBaseUnknown* iGeo) 2������� ������� �0���� �#��������������������������� ���"�

Page 38: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

34

��������iGeo

���� �����������"�

+������ ���

public int getNrAttributes() %����������� ������������� ������� ������������������"�

+����������������� ����

public DCBapUdfAttribute* getAttribute(int iIndex) /���������������� �������������������"�

��������iIndex

������+� ������������"�

+�����

����������"�

public ostream& print(ostream& iOs) ��������� �0���� �������"��������� ������� ��� �XX� ����W(���>������������?��W�"�

��������iOs

��������� �#���� "�

+�������������#������ "�

DCBapResult

>���������� ��������� ���������� ������"����� ������� ����������������� ���� ���������������������"�

�����������

public DCBapResult() �������� ������ "�

���� �

Public virtual void initResult(CATBaseUnknown* iData) = 0 �������������� �0��"�

��������iData

���� ������� �������������� �0���#���"�

public virtual ostream& print(ostream& iOs) = 0 #������������������ �0���� �������"�

Page 39: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

35

��������iOs

��������� �#���� "�

+�������������#������ "�

DCBapTopoResult

Class to represent non-editable topological data in a document. Inherits from DCBapResult.

�����������

public DCBapTopoResult() �������� ������ "�

���� �

public void initResult(CATBaseUnknown* iData) �������������� �0��"�

��������iData

���� ������� �������������� �0���#���"�

public ostream& print(ostream& iOs) #������������������ �0���� �������"�

��������iOs

��������� �#���� "�

+�����

��������#������ "�

DCBapUdfResult

Class to represent a non-editable user defined feature. Inherits from DCBapResult.

�����������

public DCBapUdfResult() �������� ������ "�

���� �

public void initResult(CATBaseUnknown* iData) �������������� �0��"�

��������iData

���� ������� �������������� �0���#���"�

public ostream& print(ostream& iOs) #������������������ �0���� �������"�

Page 40: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

36

��������iOs

��������� �#���� "�

+�������������#������ "�

DCBapUdf

������� ���������������������"�

�����������

public DCBapUdf(CATBaseUnknown* iUdf = NULL) �������� ������ "�

��������iUdf

������������"�

������������������

���������>��?��W��������V���>��?��W��/����

��������iRhs

�����>��?���� �������"�

+������������������>��?��"�

���� �

public CATUnicodeString getAlias() %�����������(�������(� ����� �0��"�

+�������������"�

public DCBapUdfAttribute* getAttribute(int iIndex) /����������������� ������� �������"�

��������iIndex

������+� ������������"�

+�����

����������"�

public int getNrAttributes() %��������������� ���"�

+������������� ����������"�

public int getNrOutputs() /�������� ������� ���"�

Page 41: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

37

+������������� �� ������"�

public DCBapOutput* getOutput(int iIndex) %��������������� ���"�

+�����

�������� �� ������"�

public CATUnicodeString getType() /������������ ��������"�

+����������������������"�

public ostream& print(ostream& iOs) #������������������ �0���� �������"��������� ���������� ��� XX� ����W(���>��?��W�"�

��������iOs

��������� �#���� "�

+�����

��������#������ "�

DCBapUdfAttribute

������� ����������������� �������"�

������������

public DCBapUdfAttribute(CATISpecAttribute* iSA)

��������iSA

�������������������������� �"�

public DCBapUdfAttribute(DCBapUdfAttribute& iAtt) � ���� ������ "�

��������iAtt

������������ �� ��"�

������������������

public DCBapUdfAttribute& operator=(DCBapUdfAttribute& iRhs)

��������iRhs

������������ �������"�

+�����

������������������"�

���� �

public CATUnicodeString& getName()

Page 42: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

38

/������������ ������������"�

+�����

������� ������������"�

public int getIntegerValue() /������������� �������������#��������� ����������"�

+�����

�������� �)<<� �� "�

public CATUnicodeString getStringValue() /������������� �������������#��������� �����������"�

+�����

������������������� ��������������� �� "�

public void setValue(int iInt) 2����������� �������������#��������� ����������"�

��������iInt

����#�����"�

public void setValue(char* iString) 2����������� �������������#��������� �����������"�

��������iString

����#�����"�

public void setValue(CATISpecObject_var& iSpec) 2����������� �������������#��������� ������������ �����"�

��������iSpec

����#�����"�

public ostream& print(ostream& iOs) J���������������� �������"�?������ ��� XX��"�

��������iOs

��������� �#���� "�

+�����

��������#������ "�

public ostream& printValue(ostream& iOs) J������������ �������������� �������"�

Page 43: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

39

��������iOs

��������� �#���� "�

+�������������#������ "�

DCBapUdfInput

������� ������������� ������"�

������������

public DCBapUdfInput(CATBaseUnknown* iInput = NULL, CATUnicodeString iRole = “”) �������� ������ "�

���������iInput

��������"�iRole

��� �� ����������"�

public DCBapUdfInput(DCBapInput& iRhs) � ���� ������ "�

��������iRhs

���������� �� ��"�

������������������

public DCBapUdfInput& operator=(DCBapUdfInput& iRhs)

��������iRhs

���������� �������"�

+�����

����������������"�

���� �

public ostream& print(ostream& iOs) J�������������� �������"�

��������iOs

��������� �#���� "�

+�����

��������#������ "�

DCBapUdfOutput

Class to represent the output from a udf.

������������

public DCBapUdfOutput(CATBaseUnknown* iOutput = NULL)

Page 44: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

40

�������� ������ "�

���������iOutput

��� �����"�iRole

��� �� ����� �����"�

public DCBapUdfOutput(DCBapOutput& iRhs) � ���� ������ "�

��������iRhs

��� ������� �� ��"�

������������������

public DCBapUdfOutput& operator=(DCBapUdfOutput& iRhs)

��������iRhs

��� ������� �������"�

+���������������� �����"�

���� �

public ostream& print(ostream& iOs) J������� ������� �������"�

��������iOs

��������� �#���� "�

+�����

��������#������ "�

DCBapUdfParameter

Class to represent a parameter of an attribute.

������������

public DCBapUdfParameter(CATBaseUnknown* iParam = “NULL”, unsigned int iIndex = 0, CATUnicodeString iRole = “”) �������� ������ "�

���������iParam

�������"�iIndex

���+� ��������������������"�iRole

��� �� ����������"�

public DCBapUdfParameter(DCBapUdfParameter& iRhs) � ���� ������ "�

Page 45: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

41

��������iRhs

���������� �� ��"�

������������������

public DCBapUdfParameter& operator=(DCBapUdfParameter& iRhs)

��������iRhs

���������� �������"�

+���������������������"�

���� �

public ostream& print(ostream& iOs) J�������������� �������"�

��������iOs

��������� �#���� "�

+�������������#������ "�

DCBapUdfSU

������� ���������������"�*��������������� �������������������� ��� ���������������������� ��"�

������������

public DCBapUdfSU(CATUnicodeString iType = “”) �������� ������ "�

��������iType

������� ������������"�

public DCBapUdfSU(DCBapUdfSU& iRhs) � ���� ������ "�

��������iRhs

������������ �� ��"�

������������������

public DCBapUdfSU& operator=(DCBapUdfSU& iRhs)

Page 46: Development of a Modular API for the CAD-System Catia V5 · PDF fileDevelopment of a Modular API for the CAD-System Catia V5 TOMAS FORS Master’s Degree Project Stockholm, Sweden

��������������� ���������������������������

42

��������iRhs

������������ �������"�

+�����������������������"�

���� �

public void addDoubleAttribute(char* iName) ���������������� ������� ����� �����������"�

��������iName

������� �������������� ����"�

public void addIntegerAttribute(char* iName) ���������������� ������������ �����������"�

��������iName

������� �������������� ����"�

public void addStringAttribute(char* iName)

���������������� ������������� �����������"�

��������iName

������� �������������� ����"�

public HRESULT saveToCatalog(CATUnicodeString* iCatalogName, CATUnicodeString* iClientId, const char* iIFName = “CATISpecObject”) 2���������������� �������� ��"�

���������iCatalogName

������� ���������� ���� ��� ��������������"�.����������������������������������"�

iClientId ��������� ������#������������ �"�

iIFName ����������� �����������������"�

+�����2S:T����� � ��#��� ����"�

B.3 Non-member functions

������������������ �� �������������� �� �� ��� XX�� ����W��:�(�� ����� ��W��/���"���������� �������� �#��������������� ���� ���� ������ �0���� �������"�