Skip to content

Commit

Permalink
Merge branch 'developement'
Browse files Browse the repository at this point in the history
  • Loading branch information
evereux committed Mar 17, 2024
2 parents 26a09b4 + f261832 commit cf90cf8
Show file tree
Hide file tree
Showing 76 changed files with 241 additions and 168 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
# Changelog


## 0.6.7

* fix type hinting issue with python 3.9. #194 @mokrueger
* updated Factory_2D.create_spline() so that it will now accept a tuple of
control_points instead of their com_objects. #199 @mokrueger
* updated iter methods to use .Item instead of .item. The resolves issues where
the pycatia user is using a modified com interface provided by Dassault.
#195 @mokrueger.
* added missing method ShapeFactory.add_new_translate2() #202 There is currently
a quirk with regard to its usage. See the GitHub issue #202 for further
information.
* improved Parameters handling. #197 @mokrueger


## 0.6.6

* fixed method document.indicate_2d()
* fixed method document.indicate_3d()
* fixed method selection.indicate_or_select_element_2d() @hitman061
* renamed Outputs.count_ due to name clash with Collection.
* fixes due to mypy checking. There are still errors report buted not sure how
* fixes due to mypy checking. There are still errors report but not sure how
to fix at this time.


## 0.6.5

* added ShapeFactory.add_new_rotate_2. This class method was missing in the
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Mebiza

Mithro86

mokrueger

ptm-tm

Tian-Jionglu
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ A reminder for @evereux. I don't do this often and forget ...
* Run the examples.
* Fix any issues.

* Build the docs. `cd docs` `make html`
* Build the docs. `cd docs` `./make html`
* Fix any issues.

* Run mypy over module. `mypy pycatia`
Expand Down
2 changes: 1 addition & 1 deletion docs/api/pycatia/types.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _Types:
.. _types:

types
=====
Expand Down
2 changes: 1 addition & 1 deletion docs/api/pycatia/version.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.. _Version:
.. _version:

version
=======
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def __getattr__(cls, name):
# -- Project information -----------------------------------------------------

project = 'pycatia'
copyright = '2023, Paul Bourne'
copyright = '2024, Paul Bourne'
author = 'Paul Bourne'

# The short X.Y version
version = '0.6.6'
version = '0.6.7'
# The full version, including alpha/beta/rc tags
release = version

Expand Down
4 changes: 2 additions & 2 deletions docs/examples.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _examples:

Examples
========

Expand Down Expand Up @@ -143,8 +145,6 @@ Close a catia file.
DRAFTING EXAMPLES
-----------------

I have created a github repository with a more complex drafting example that creates a drawing format with title block.
That can be found at here `pycatia-drawing-template <https://github.com/evereux/pycatia-drawing-template>`_

Drafting - Example 1
~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion docs/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ number of properties that can be accessed.
Creating A Geometrical Set
--------------------------

A geometrical set created using the :ref:`HybridBodies<Hybrid_bodies>` collection. Your CATIA
A geometrical set created using the :ref:`HybridBodies<HybridBodies>` collection. Your CATIA
configuration may by default create a geometrical set in a new CATPart but we'll
create one here anyway.

Expand Down
4 changes: 3 additions & 1 deletion docs/user_scripts.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _user_scripts:

User Scripts
============

Expand Down Expand Up @@ -47,7 +49,7 @@ Creates screenshots of all parts and products within a given directory.

See script header for more information.

`create_screenshots_of_parts_and_products.py <<https://github.com/evereux/pycatia/blob/master/user_scripts/create_screenshots_of_parts_and_products.py>`_
`create_screenshots_of_parts_and_products.py <https://github.com/evereux/pycatia/blob/master/user_scripts/create_screenshots_of_parts_and_products.py>`_



Expand Down
4 changes: 2 additions & 2 deletions pycatia/cat_logger.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import logging

import sys

from typing import Optional

# the following code was shamefully pilfered from Flask's logging.


def has_level_handler(logger: logging.Logger | None):
def has_level_handler(logger: Optional[logging.Logger]):
"""
Check if there is a handler in the logging chain that will handle the
Expand Down
4 changes: 2 additions & 2 deletions pycatia/cat_tps_interfaces/annotation_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ def __getitem__(self, n: int) -> AnnotationSet:
if (n + 1) > self.count:
raise StopIteration

return AnnotationSet(self.annotation_sets.item(n + 1))
return AnnotationSet(self.annotation_sets.Item(n + 1))

def __iter__(self) -> Iterator[AnnotationSet]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'AnnotationSets(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/cat_tps_interfaces/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ def __getitem__(self, n: int) -> Annotation:
if (n + 1) > self.count:
raise StopIteration

return Annotation(self.annotations.item(n + 1))
return Annotation(self.annotations.Item(n + 1))

def __iter__(self) -> Iterator[Annotation]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'Annotations(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/cat_tps_interfaces/assembly_annotation_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def __getitem__(self, n: int) -> AnnotationSet:
if (n + 1) > self.count:
raise StopIteration

return AnnotationSet(self.assembly_annotation_sets.item(n + 1))
return AnnotationSet(self.assembly_annotation_sets.Item(n + 1))

def __iter__(self) -> Iterator[AnnotationSet]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'AssemblyAnnotationSets(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/cat_tps_interfaces/captures.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ def __getitem__(self, n: int) -> Capture:
if (n + 1) > self.count:
raise StopIteration

return Capture(self.captures.item(n + 1))
return Capture(self.captures.Item(n + 1))

def __iter__(self) -> Iterator[Capture]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'Captures(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/cat_tps_interfaces/tps_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ def __getitem__(self, n: int) -> TPSView:
if (n + 1) > self.count:
raise StopIteration

return TPSView(self.tps_views.item(n + 1))
return TPSView(self.tps_views.Item(n + 1))

def __iter__(self) -> Iterator[TPSView]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'TpsViews(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/cat_tps_interfaces/user_surfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ def __getitem__(self, n: int) -> UserSurface:
if (n + 1) > self.count:
raise StopIteration

return UserSurface(self.user_surfaces.item(n + 1))
return UserSurface(self.user_surfaces.Item(n + 1))

def __iter__(self) -> Iterator[UserSurface]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'UserSurfaces(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/drafting_interfaces/drawing_arrows.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ def __getitem__(self, n: int) -> DrawingArrow:
if (n + 1) > self.count:
raise StopIteration

return DrawingArrow(self.drawing_arrows.item(n + 1))
return DrawingArrow(self.drawing_arrows.Item(n + 1))

def __iter__(self) -> Iterator[DrawingArrow]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'DrawingArrows(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/drafting_interfaces/drawing_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ def __getitem__(self, n: int) -> DrawingComponent:
if (n + 1) > self.count:
raise StopIteration

return DrawingComponent(self.drawing_components.item(n + 1))
return DrawingComponent(self.drawing_components.Item(n + 1))

def __iter__(self) -> Iterator[DrawingComponent]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'DrawingComponents()'
4 changes: 2 additions & 2 deletions pycatia/drafting_interfaces/drawing_dimensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,11 @@ def __getitem__(self, n: int) -> DrawingDimension:
if (n + 1) > self.count:
raise StopIteration

return DrawingDimension(self.drawing_dimensions.item(n + 1))
return DrawingDimension(self.drawing_dimensions.Item(n + 1))

def __iter__(self) -> Iterator[DrawingDimension]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'DrawingDimensions(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/drafting_interfaces/drawing_leaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ def __getitem__(self, n: int) -> DrawingLeader:
if (n + 1) > self.count:
raise StopIteration

return DrawingLeader(self.drawing_leaders.item(n + 1))
return DrawingLeader(self.drawing_leaders.Item(n + 1))

def __iter__(self) -> Iterator[DrawingLeader]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'DrawingLeaders(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/drafting_interfaces/drawing_pictures.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,11 @@ def __getitem__(self, n: int) -> DrawingPicture:
if (n + 1) > self.count:
raise StopIteration

return DrawingPicture(self.drawing_pictures.item(n + 1))
return DrawingPicture(self.drawing_pictures.Item(n + 1))

def __iter__(self) -> Iterator[DrawingPicture]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'DrawingPictures(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/drafting_interfaces/drawing_sheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ def __getitem__(self, n: int) -> DrawingSheet:
if (n + 1) > self.count:
raise StopIteration

return DrawingSheet(self.drawing_sheets.item(n + 1))
return DrawingSheet(self.drawing_sheets.Item(n + 1))

def __iter__(self) -> Iterator[DrawingSheet]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'DrawingSheets(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/drafting_interfaces/drawing_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ def __getitem__(self, n: int) -> DrawingTable:
if (n + 1) > self.count:
raise StopIteration

return DrawingTable(self.drawing_tables.item(n + 1))
return DrawingTable(self.drawing_tables.Item(n + 1))

def __iter__(self) -> Iterator[DrawingTable]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'DrawingTables(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/drafting_interfaces/drawing_texts.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ def __getitem__(self, n: int) -> DrawingText:
if (n + 1) > self.count:
raise StopIteration

return DrawingText(self.drawing_texts.item(n + 1))
return DrawingText(self.drawing_texts.Item(n + 1))

def __iter__(self) -> Iterator[DrawingText]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'DrawingTexts(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/drafting_interfaces/drawing_threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ def __getitem__(self, n: int) -> DrawingThread:
if (n + 1) > self.count:
raise StopIteration

return DrawingThread(self.drawing_threads.item(n + 1))
return DrawingThread(self.drawing_threads.Item(n + 1))

def __iter__(self) -> Iterator[DrawingThread]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'DrawingThreads(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/drafting_interfaces/drawing_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,11 @@ def __getitem__(self, n: int) -> DrawingView:
if (n + 1) > self.count:
raise StopIteration

return DrawingView(self.drawing_views.item(n + 1))
return DrawingView(self.drawing_views.Item(n + 1))

def __iter__(self) -> Iterator[DrawingView]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'DrawingViews(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/drafting_interfaces/drawing_weldings.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ def __getitem__(self, n: int) -> DrawingWelding:
if (n + 1) > self.count:
raise StopIteration

return DrawingWelding(self.drawing_weldings.item(n + 1))
return DrawingWelding(self.drawing_weldings.Item(n + 1))

def __iter__(self) -> Iterator[DrawingWelding]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'DrawingWeldings(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/in_interfaces/cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ def __getitem__(self, n: int) -> Camera:
if (n + 1) > self.count:
raise StopIteration

return Camera(self.cameras.item(n + 1))
return Camera(self.cameras.Item(n + 1))

def __iter__(self) -> Iterator[Camera]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'Cameras(name="{self.name}")'
4 changes: 2 additions & 2 deletions pycatia/in_interfaces/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,11 @@ def __getitem__(self, n: int) -> Document:
if (n + 1) > self.count:
raise StopIteration

return Document(self.documents.item(n + 1))
return Document(self.documents.Item(n + 1))

def __iter__(self) -> Iterator[Document]:
for i in range(self.count):
yield self.child_object(self.com_object.item(i + 1))
yield self.child_object(self.com_object.Item(i + 1))

def __repr__(self):
return f'Documents(name="{self.name}")'
Loading

0 comments on commit cf90cf8

Please sign in to comment.