Skip to content

Commit

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

@pyaedt_function_handler()
def _refresh_solids(self):
self.__refresh_object_type("Solids")
# 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

@pyaedt_function_handler()
def _refresh_sheets(self):
self.__refresh_object_type("Sheets")
# 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

@pyaedt_function_handler()
def _refresh_lines(self):
self.__refresh_object_type("Lines")
# 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

@pyaedt_function_handler()
def _refresh_unclassified(self):
self.__refresh_object_type("Unclassified")
# self.__refresh_object_type("Unclassified")
try:
test = self.oeditor.GetObjectsInGroup("Unclassified")

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
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

Check warning on line 8614 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#L8610-L8614

Added lines #L8610 - L8614 were not covered by tests
else:
self._unclassified = list(test)

Check warning on line 8616 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#L8616

Added line #L8616 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 7b2538f

Please sign in to comment.