Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Model export #672

Merged
merged 24 commits into from
Dec 27, 2021
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0e1f839
Improved Model export
maxcapodi78 Dec 22, 2021
69d8895
Update pyaedt/modules/AdvancedPostProcessing.py
MaxJPRey Dec 23, 2021
f5d986a
Add arguments documentation.
MaxJPRey Dec 23, 2021
4d26874
Fix python black code style issue.
MaxJPRey Dec 23, 2021
57f5550
Add space before the colon separating the pa.
MaxJPRey Dec 23, 2021
b6eebed
Add space before the colon separating the parameter and its type.
MaxJPRey Dec 23, 2021
99fd2c9
Merge branch 'main' into Enhancement/Plot_model
maxcapodi78 Dec 23, 2021
7896a44
Improved plot model
maxcapodi78 Dec 23, 2021
70f24dd
Merge remote-tracking branch 'origin/Enhancement/Plot_model' into Enh…
maxcapodi78 Dec 23, 2021
44080a7
Improved plot model
maxcapodi78 Dec 23, 2021
534690f
Improved plot model
maxcapodi78 Dec 23, 2021
3b0ce58
Update pyaedt/modules/AdvancedPostProcessing.py
maxcapodi78 Dec 23, 2021
c45aa06
Improved plot model.
maxcapodi78 Dec 23, 2021
1307d59
Merge remote-tracking branch 'origin/Enhancement/Plot_model' into Enh…
maxcapodi78 Dec 23, 2021
72d8ef6
Fixed Style errors
maxcapodi78 Dec 23, 2021
8991e3a
black style
maxcapodi78 Dec 23, 2021
d781a2b
Update pyaedt/modules/AdvancedPostProcessing.py
MaxJPRey Dec 24, 2021
72a06bc
Update pyaedt/modules/AdvancedPostProcessing.py
MaxJPRey Dec 24, 2021
122e305
Update pyaedt/modules/AdvancedPostProcessing.py
MaxJPRey Dec 24, 2021
22c1205
Update pyaedt/modules/AdvancedPostProcessing.py
MaxJPRey Dec 24, 2021
8c5acd4
Update pyaedt/modules/AdvancedPostProcessing.py
MaxJPRey Dec 24, 2021
0bfa2fe
Update pyaedt/modules/AdvancedPostProcessing.py
MaxJPRey Dec 24, 2021
1fddaba
Update pyaedt/modeler/Object3d.py
MaxJPRey Dec 24, 2021
315d96b
Apply suggestions from code review
maxcapodi78 Dec 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions pyaedt/modeler/Object3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from pyaedt.modeler.GeometryOperators import GeometryOperators
from pyaedt.application.Variables import decompose_variable_value
from pyaedt.generic.constants import AEDT_UNITS, MILS2METER
from pyaedt.generic.general_methods import is_ironpython

clamp = lambda n, minn, maxn: max(min(maxn, n), minn)

Expand Down Expand Up @@ -768,6 +769,59 @@ def _odesign(self):
"""Design."""
return self._primitives._modeler._app._odesign

@aedt_exception_handler
def plot(self):
"""Plot model with PyVista.

.. note::
Works from AEDT 2021.2 in CPython only. PyVista has to be installed.
"""
if not is_ironpython and self._primitives._appp._aedt_version >= "2021.2":
self._primitives._app.post.plot_model_obj(
objects=[self.name],
export_afterplot=False,
plot_separate_objects=True,
air_objects=True,
background_color="grey",
object_selector=False,
color="dodgerblue",
off_screen=False,
)

@aedt_exception_handler
def export_image(self, file_path=None):

"""Export the model to path.

.. note::
Works from AEDT 2021.2 in CPython only. PyVista has to be installed.

Parameters
----------
file_path : str
MaxJPRey marked this conversation as resolved.
Show resolved Hide resolved
File name with full path. If `None` Project directory will be used.

Returns
-------
str
File path.
"""
if not is_ironpython and self._primitives._appp._aedt_version >= "2021.2":
files = self._primitives._app.post.plot_model_obj(
objects=[self.name],
export_afterplot=True,
export_path=file_path,
plot_separate_objects=True,
air_objects=True,
background_color="grey",
object_selector=False,
color="dodgerblue",
off_screen=True,
)
if files:
return files[0]
return False

@property
def faces(self):
"""Information for each face in the given part.
Expand Down
Loading