Skip to content

Commit

Permalink
FEAT: Force an EMIT save after analysis (#5166)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryankaylor authored Sep 12, 2024
1 parent ce3b625 commit 435e2c0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
29 changes: 29 additions & 0 deletions src/ansys/aedt/core/emit.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,3 +330,32 @@ def get_units(self, unit_type=""):
)
return None
return self._units[unit_type]

@pyaedt_function_handler()
def save_project(self, file_name=None, overwrite=True, refresh_ids=False):
"""Save the AEDT project and the current EMIT revision.
Parameters
----------
file_name : str, optional
Full path and project name. The default is ````None``.
overwrite : bool, optional
Whether to overwrite the existing project. The default is ``True``.
refresh_ids : bool, optional
Whether to refresh object IDs after saving the project.
The default is ``False``.
Returns
-------
bool
``True`` when successful, ``False`` when failed.
References
----------
"""
if self.__emit_api_enabled:
self._emit_api.save_project()

result = Design.save_project(self, file_name, overwrite, refresh_ids)

return result
6 changes: 3 additions & 3 deletions src/ansys/aedt/core/emit_core/results/revision.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def run(self, domain):
if len(domain.interferer_names) > 1:
raise ValueError("Multiple interferers cannot be specified prior to AEDT version 2024 R1.")
interaction = engine.run(domain)
# save the revision
self.emit_project._emit_api.save_project()
# save the project and revision
self.emit_project.save_project()
return interaction

@pyaedt_function_handler()
Expand Down Expand Up @@ -396,7 +396,7 @@ def notes(self):
@notes.setter
def notes(self, notes):
self.emit_project.odesign.SetResultNotes(self.name, notes)
self.emit_project._emit_api.save_project()
self.emit_project.save_project()

@property
def n_to_1_limit(self):
Expand Down

0 comments on commit 435e2c0

Please sign in to comment.