Skip to content

Commit 39789d1

Browse files
committed
Merge branch 'developement'
2 parents 265dae1 + fa5b51c commit 39789d1

File tree

1,564 files changed

+211257
-250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,564 files changed

+211257
-250
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ pycatia-exe.build
140140
pycatia-exe.dist
141141
zip_win32_dist.py
142142
win_32/pycatia
143-
pycatia-exe.py
144143
logo*
145144
*.cgr
146145

CHANGELOG.md

Lines changed: 76 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,87 @@
11
# Changelog
22

3+
## 0.6.0
4+
5+
* Removed deprecated method Product.get_products() use Product.products instead.
6+
* Added the following new modules:
7+
* abq_automation_interfaces
8+
* analysis_interfaces
9+
* arrangement_interfaces
10+
* assembly_interfaces
11+
* behaviour_interfaces
12+
* bkt_interfaces
13+
* cat_dde_settings_interfaces
14+
* cat_ipd_adapter_interfaces
15+
* cat_plant_ship_interfaces (PSP)
16+
* cat_rdg_interfaces
17+
* cat_rsc_interfaces
18+
* cat_sch_platform_interfaces
19+
* cat_sde_interfaces
20+
* cat_sm_interfaces
21+
* cat_smarteam_integ_interfaces
22+
* cat_str_functional_interfaces
23+
* cat_tps_interfaces
24+
* catia_v4_interfaces
25+
* catia_de_settings_interfaces
26+
* composites_interfaces
27+
* dnb_asy_activity_interfaces
28+
* dnb_d5_interfaces
29+
* dnb_device_activity_interfaces
30+
* dnb_device_interfaces
31+
* dnb_dpm_interfaces
32+
* dnb_ehm_interfaces
33+
* dnb_ehs_interfaces
34+
* dnb_ekp_interfaces
35+
* dnb_fastener_interfaces
36+
* dnb_graph_editor
37+
* dnb_human_modelling_interfaces
38+
* dnb_human_sim_interfaces
39+
* dnb_igp_arc_commands
40+
* dnb_lgp_olp_ui
41+
* dnb_igp_setup_interfaces
42+
* dnb_manufacturing_layout_interfaces
43+
* dnb_mhi_interfaces
44+
* dnb_reporting_interfaces
45+
* dnb_resource_program_interfaces
46+
* dnb_robot_interfaces
47+
* dnb_sim_activity_interfaces
48+
* dnb_simulation_interfaces
49+
* dnb_sor_interfaces
50+
* dnb_state_interfaces
51+
* dnb_work_interfaces
52+
* dmaps_interfaces
53+
* drafting_2dl_interfaces
54+
* electrical_schematic_interfaces
55+
* eno_cd5_interfaces
56+
* fitting_interfaces
57+
* general_knowledge_interfaces
58+
* kinematics_interfaces
59+
* manufacturing_interfaces
60+
* multi_cad_interfaces
61+
* osm_interfaces
62+
* pcb_board_base
63+
* ppr_interfaces
64+
* prismatic_machining_interfaces
65+
* reporter_interfaces
66+
* simulation_interfaces
67+
* smt_interfaces
68+
* structure_interfaces
69+
* surface_machining_interfaces
70+
* threed_xml_interfaces
71+
372
## 0.5.9
473

574
* Added missing com_oject to references in navigator_interfaces. (@evereux & @marciolrc)
675
* Fixed reference plane method in HybridShapePlaneAngle. (@Mithro86)
7-
* Updates to examples to include latest supported python version. Also fix IDE autocompletion & syntax highlighting
8-
issues. (@deloarts)
9-
*
76+
* Updates to examples to include latest supported python version. Also fix IDE autocompletion & syntax highlighting
77+
issues. (@deloarts)
1078

1179
## 0.5.8
1280

1381
* Added new document type CatalogDocument.
1482
* Added new document type CATMaterial.
15-
* fixed method for AxisSystem.origin_point, AxisSystem.x_axis_direction, AxisSystem.y_axis_direction and
16-
AxisSystem.z_axis_direction. (@Mithro86)
83+
* fixed method for AxisSystem.origin_point, AxisSystem.x_axis_direction, AxisSystem.y_axis_direction and
84+
AxisSystem.z_axis_direction. (@Mithro86)
1785
* Added warning to example__assembly_convertor__001.py for when writing to files. (@deloarts)
1886
* fixed method for Limit.limiting_element(). (@ptm-tm)
1987

@@ -23,8 +91,7 @@
2391
* fixed method for AxisSystem.get_vectors(). (@Mithro86)
2492
* Partial fix to Selection.indicate_or_select_element_3d(). (@Mithro86)
2593
* added pathlib.Path to DrawingPictures.add().
26-
* now tries to get the Windows absolute path from input as CATIA may not be
27-
able to otherwise find the file.
94+
* now tries to get the Windows absolute path from input as CATIA may not be able to otherwise find the file.
2895
* References to python 3.6 now updated to 3.9 due to type annotation support.
2996
* fixed method for Line.get_direction(). (@Mithro86)
3097

@@ -49,8 +116,8 @@
49116

50117
## 0.5.3
51118

52-
* fixed methods in pycatia/mec_mod_interfaces/axis_system and pycatia/mec_mod_interfaces/cylindrical_face.py
53-
that required mapping to VBA methods.
119+
* fixed methods in pycatia/mec_mod_interfaces/axis_system and pycatia/mec_mod_interfaces/cylindrical_face.py that
120+
required mapping to VBA methods.
54121

55122
## 0.5.2
56123

CONTRIBUTING.md

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,29 @@
22

33
# Git / Github
44

5-
If you would like to contribute to pycatia there are a number of ways you can do
6-
this.
5+
If you would like to contribute to pycatia there are a number of ways you can do this.
76

8-
If you contribution is to the codebase you should learn the basics of git /
9-
github and how to create a fork of pycatia and then a new branch for your
10-
specific pull request and creating the pull request itself. This can be done
11-
via the github web interface itself and this is fine too but it's worth
12-
learning git I think.
7+
If your contribution is to the codebase you should learn the basics of git and github and how to create a fork of
8+
pycatia and then a new branch for your specific pull request and creating the pull request itself.
139

14-
With your pull request please also submit a small section of code that
15-
demonstrates how to use the class method you have added / fixed.
10+
With your pull request please also submit a small section of code that demonstrates how to use the class method you have
11+
added / fixed.
1612

1713
# Which branch should I work on?
1814

19-
The master branch represents the latest released version of pycatia. Any pull
20-
requests against the pycatia application itself shall not be done to this
21-
branch but the `developement` branch.
15+
The master branch represents the latest released version of pycatia. Any pull requests against the pycatia application
16+
itself shall not be done to this branch but the `developement` branch.
2217

2318
However, changes to the documentation or examples can be done against either.
2419

2520
## Adding new modules
2621

27-
If you would like to add a module to pycatia please see the contents of
28-
`v5automation-autogenerated.7z`. This archive was created by scraping through
29-
the contents of the V5Automation.chm help file to re-construct all the classes
30-
and methods for python. It's largely complete but won't work out the box
31-
without some tweaking. But these files should be the basis for any pull
32-
requests. They will save you sometime and effort and ensure some consistency
33-
for the project.
22+
I have now added all the modules I was able to extract from the documentation so there shouldn't be a need to add new
23+
modules as of 0.6.0.
3424

3525
## Scripts / Examples
3626

37-
New scripts / examples are always welcome as they great for new users to
38-
discover how to use pycatia.
27+
New scripts / examples are always welcome as they great for new users to discover how to use pycatia.
3928

4029
If you have written a script using pycatia you would like to share you can:
4130

@@ -45,7 +34,6 @@ If you have written a script using pycatia you would like to share you can:
4534

4635
## Tests
4736

48-
There is a test framework in place that covers the basic set of pycatia
49-
features. However, there is a lot of work to do here in expanding on those.
50-
Pull-requests expanding on these tests would be very much appreciated.
37+
There is a test framework in place that covers the basic set of pycatia features. However, there is a lot of work to do
38+
here in expanding on those. Pull-requests expanding on these tests would be very much appreciated.
5139

README.rst

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,23 @@ pycatia
1010
alpha software
1111
--------------
1212

13-
This is alpha software. All the test cases and examples work but there will be
14-
many issues outside of the test framework. The CATIA com interface is huge and
15-
I'm currently just attacking the items I think will be most useful. The
16-
framework is in place for others to contribute so if you know CATIA and python
17-
please do contribute. Bonus points for adding tests too.
13+
This is alpha software.
1814

19-
I have limited access to CATIA licences / workbenches so will not be able to
20-
support those I can't test. If your company would like support for additional
21-
workbenches adding to pycatia and can provide a license please contact me.
15+
All the test cases and examples work but there will be many issues outside of
16+
the test framework. The CATIA com interface is huge and I've predominantly
17+
only worked / tested on those I can figure out how to use.
18+
19+
The entire framework is now in place for others to contribute so if you know
20+
CATIA and python (being already familiar with automation using the more
21+
traditional methods will help) please do contribute. Bonus points for adding
22+
tests too.
23+
24+
I have limited access to CATIA licences / workbenches. Also, there's are many
25+
modules that I simply don't know what they do. Thus my ability to test things
26+
is extremely limited.
27+
28+
All this said many bugs that exist should be for the most part be quite easy to
29+
fix using those methods that do work as a reference.
2230

2331

2432
Why was it made?
@@ -30,15 +38,13 @@ and it's methods without the need of visual basic / CATScripts.
3038
Some of the methods can be accessed directly using the pywin32 module but there
3139
are a number that just simply won't work using python. There are several
3240
questions on stack overflow and the pywin32 mailing list regarding this. But,
33-
they fail to provide any working examples with the Measurable object in python.
34-
41+
they failed to provide any working examples with the Measurable object in python.
3542

3643
pycatia accesses these methods by running VBA scripts using the
3744
`Dispatch('CATIA.Application').SystemService.Evaluate()` function and passing a
3845
public function to it. Otherwise, pycatia uses the VB method directly but
3946
exposes it within the same python class.
4047

41-
4248
There is now further functionality available which can be seen by looking at
4349
the examples provided and reading the API at pycatia.readthedocs.io_.
4450

api_builder.py

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
"""
2+
A simple script to generate API documentation for new modules.
3+
"""
4+
5+
import os
6+
from pathlib import Path
7+
8+
# module folder(s) within pycatia
9+
modules = ['threed_xml_interfaces']
10+
11+
cwd = Path(os.getcwd())
12+
13+
folder_doc_api = Path(cwd, 'docs/api')
14+
folder_pycatia = Path(cwd, 'pycatia')
15+
16+
17+
def get_index_contents(module_name):
18+
folder = Path(folder_pycatia, module_name)
19+
dir_contents = os.listdir(folder)
20+
21+
o = ''
22+
23+
for file in dir_contents:
24+
if file == '__init__.py' or file == '__pycache__':
25+
continue
26+
f = file[0:-3]
27+
o = o + f' pycatia/{module_name}/{f}\n'
28+
29+
return o, dir_contents
30+
31+
32+
def build_index(module_name):
33+
index_filename = Path(folder_doc_api, f'index_{module_name}.rst')
34+
35+
# if file already exists skip.
36+
if index_filename.exists():
37+
print(f'"{index_filename}" already exists.')
38+
os.remove(index_filename)
39+
40+
header = f'pycatia.{module_name}\n'
41+
header_underline = '=' * len(header)
42+
toc_tree = '\n\n' \
43+
'.. toctree::\n' \
44+
' :maxdepth: 1\n' \
45+
' :caption: Contents:\n\n\n'
46+
contents, dir_content = get_index_contents(module_name)
47+
48+
text = header + header_underline + toc_tree + contents
49+
50+
print(f'creating file {index_filename}')
51+
with open(index_filename, 'w') as file:
52+
file.write(text)
53+
54+
return dir_content
55+
56+
57+
def build_api(module_name, dir_content):
58+
module_api_folder = Path(folder_doc_api, 'pycatia', module_name)
59+
# create the folder
60+
if not module_api_folder.exists():
61+
print(f'Creating folder {module_api_folder}.')
62+
os.mkdir(module_api_folder)
63+
64+
for file in dir_content:
65+
m = file[0:-3]
66+
if file == '__init__.py' or file == '__pycache__':
67+
continue
68+
f_api_name = Path(module_api_folder, f'{m}.rst')
69+
70+
header_link = f'.. _{module_name.capitalize()}:\n\n'
71+
header = f'pycatia.{module_name}.{m}\n'
72+
header_underline = '=' * len(header)
73+
auto_module = f'\n\n.. automodule:: pycatia.{module_name}.{m}\n' \
74+
f' :members:\n'
75+
76+
text = header_link + header + header_underline + auto_module
77+
78+
with open(f_api_name, 'w') as file:
79+
file.write(text)
80+
81+
82+
for module_name in modules:
83+
# build index
84+
85+
dir_content = build_index(module_name)
86+
build_api(module_name, dir_content)
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
pycatia.abq_automation_interfaces
2+
==================================
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
:caption: Contents:
7+
8+
9+
pycatia/abq_automation_interfaces/abqfh_output_request
10+
pycatia/abq_automation_interfaces/abqiaabq_base_motion_vb
11+
pycatia/abq_automation_interfaces/abqiaabq_frequency_loading_vb
12+
pycatia/abq_automation_interfaces/abqiaabq_steady_state_lin_dyn_step_basic_vb
13+
pycatia/abq_automation_interfaces/abqiaabq_steady_state_lin_dyn_step_modal_vb
14+
pycatia/abq_automation_interfaces/abqiaabq_steady_state_lin_dyn_step_subspace_vb
15+
pycatia/abq_automation_interfaces/abq_analysis_case
16+
pycatia/abq_automation_interfaces/abq_analysis_cases
17+
pycatia/abq_automation_interfaces/abq_analysis_model
18+
pycatia/abq_automation_interfaces/abq_analytical_rigid_surface
19+
pycatia/abq_automation_interfaces/abq_boundary_condition
20+
pycatia/abq_automation_interfaces/abq_boundary_conditions
21+
pycatia/abq_automation_interfaces/abq_clamp_bc
22+
pycatia/abq_automation_interfaces/abq_concentrated_force
23+
pycatia/abq_automation_interfaces/abq_damper_connection_property
24+
pycatia/abq_automation_interfaces/abq_data_output_request
25+
pycatia/abq_automation_interfaces/abq_data_output_requests
26+
pycatia/abq_automation_interfaces/abq_displacement_bc
27+
pycatia/abq_automation_interfaces/abq_display_group
28+
pycatia/abq_automation_interfaces/abq_display_groups
29+
pycatia/abq_automation_interfaces/abq_explicit_dynamics_step
30+
pycatia/abq_automation_interfaces/abq_fastened_connection_enhancement
31+
pycatia/abq_automation_interfaces/abq_fastened_pair
32+
pycatia/abq_automation_interfaces/abq_fields
33+
pycatia/abq_automation_interfaces/abq_field_output_request
34+
pycatia/abq_automation_interfaces/abq_field_output_requests
35+
pycatia/abq_automation_interfaces/abq_film_condition
36+
pycatia/abq_automation_interfaces/abq_frequency_step
37+
pycatia/abq_automation_interfaces/abq_gasket_property
38+
pycatia/abq_automation_interfaces/abq_general_static_step
39+
pycatia/abq_automation_interfaces/abq_global_element_assignment
40+
pycatia/abq_automation_interfaces/abq_gravity
41+
pycatia/abq_automation_interfaces/abq_heat_transfer_step
42+
pycatia/abq_automation_interfaces/abq_history_output_request
43+
pycatia/abq_automation_interfaces/abq_history_output_requests
44+
pycatia/abq_automation_interfaces/abq_image_query
45+
pycatia/abq_automation_interfaces/abq_initial_step
46+
pycatia/abq_automation_interfaces/abq_initial_temperature
47+
pycatia/abq_automation_interfaces/abq_interaction
48+
pycatia/abq_automation_interfaces/abq_interactions
49+
pycatia/abq_automation_interfaces/abq_job
50+
pycatia/abq_automation_interfaces/abq_jobs
51+
pycatia/abq_automation_interfaces/abq_load
52+
pycatia/abq_automation_interfaces/abq_loads
53+
pycatia/abq_automation_interfaces/abq_mass_scaling
54+
pycatia/abq_automation_interfaces/abq_mass_scalings
55+
pycatia/abq_automation_interfaces/abq_mech_conn_behavior
56+
pycatia/abq_automation_interfaces/abq_output_request
57+
pycatia/abq_automation_interfaces/abq_output_requests
58+
pycatia/abq_automation_interfaces/abq_pressure
59+
pycatia/abq_automation_interfaces/abq_pretension_property
60+
pycatia/abq_automation_interfaces/abq_properties
61+
pycatia/abq_automation_interfaces/abq_property
62+
pycatia/abq_automation_interfaces/abq_rigid_body_constraint
63+
pycatia/abq_automation_interfaces/abq_rigid_coupling
64+
pycatia/abq_automation_interfaces/abq_smooth_coupling
65+
pycatia/abq_automation_interfaces/abq_smooth_step_amplitude
66+
pycatia/abq_automation_interfaces/abq_solution_case
67+
pycatia/abq_automation_interfaces/abq_solution_case_images
68+
pycatia/abq_automation_interfaces/abq_solution_step
69+
pycatia/abq_automation_interfaces/abq_solution_steps
70+
pycatia/abq_automation_interfaces/abq_solution_step_images
71+
pycatia/abq_automation_interfaces/abq_spring_connection_property
72+
pycatia/abq_automation_interfaces/abq_step
73+
pycatia/abq_automation_interfaces/abq_steps
74+
pycatia/abq_automation_interfaces/abq_surface_to_surface_contact
75+
pycatia/abq_automation_interfaces/abq_tabular_amplitude
76+
pycatia/abq_automation_interfaces/abq_temperature
77+
pycatia/abq_automation_interfaces/abq_temperature_bc
78+
pycatia/abq_automation_interfaces/abq_temperature_history
79+
pycatia/abq_automation_interfaces/abq_thermal_conn_behavior

0 commit comments

Comments
 (0)