Skip to content

Commit

Permalink
WIP: Use private refresh obj method
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys committed Jan 13, 2025
1 parent e085736 commit addaaf8
Showing 1 changed file with 4 additions and 48 deletions.
52 changes: 4 additions & 48 deletions src/ansys/aedt/core/modeler/cad/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -8600,63 +8600,19 @@ def __refresh_object_type(self, object_type: str):

@pyaedt_function_handler()
def _refresh_solids(self):
# self.__refresh_object_type("Solids")
try:
test = self.oeditor.GetObjectsInGroup("Solids")
except (TypeError, AttributeError):
test = []
if test is False:
assert False, "Get Solids is failing"
elif test is True or test is None:
self._solids = [] # In IronPython True is returned when no sheets are present
else:
self._solids = list(test)
self._all_object_names = self._solids + self._sheets + self._lines + self._points
self.__refresh_object_type("Solids")

Check warning on line 8603 in src/ansys/aedt/core/modeler/cad/primitives.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modeler/cad/primitives.py#L8603

Added line #L8603 was not covered by tests

@pyaedt_function_handler()
def _refresh_sheets(self):
# self.__refresh_object_type("Sheets")
try:
test = self.oeditor.GetObjectsInGroup("Sheets")
except (TypeError, AttributeError):
test = []
if test is False:
assert False, "Get Sheets is failing"
elif test is True or test is None:
self._sheets = [] # In IronPython True is returned when no sheets are present
else:
self._sheets = list(test)
self._all_object_names = self._solids + self._sheets + self._lines + self._points
self.__refresh_object_type("Sheets")

Check warning on line 8607 in src/ansys/aedt/core/modeler/cad/primitives.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modeler/cad/primitives.py#L8607

Added line #L8607 was not covered by tests

@pyaedt_function_handler()
def _refresh_lines(self):
# self.__refresh_object_type("Lines")
try:
test = self.oeditor.GetObjectsInGroup("Lines")
except (TypeError, AttributeError):
test = []
if test is False:
assert False, "Get Lines is failing"
elif test is True or test is None:
self._lines = [] # In IronPython True is returned when no lines are present
else:
self._lines = list(test)
self._all_object_names = self._solids + self._sheets + self._lines + self._points
self.__refresh_object_type("Lines")

Check warning on line 8611 in src/ansys/aedt/core/modeler/cad/primitives.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modeler/cad/primitives.py#L8611

Added line #L8611 was not covered by tests

@pyaedt_function_handler()
def _refresh_unclassified(self):
# self.__refresh_object_type("Unclassified")
try:
test = self.oeditor.GetObjectsInGroup("Unclassified")
except (TypeError, AttributeError):
test = []
if test is None or test is False:
self._unclassified = []
self.logger.debug("Unclassified is failing")
elif test is True:
self._unclassified = [] # In IronPython True is returned when no unclassified are present
else:
self._unclassified = list(test)
self.__refresh_object_type("Unclassified")

Check warning on line 8615 in src/ansys/aedt/core/modeler/cad/primitives.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/modeler/cad/primitives.py#L8615

Added line #L8615 was not covered by tests

# TODO: Checks should be performed to check if all objects values are really reachable
@pyaedt_function_handler()
Expand Down

0 comments on commit addaaf8

Please sign in to comment.