Skip to content

Commit 6fa05a6

Browse files
FEAT: Move It extension (#5966)
Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
1 parent 8af7aa4 commit 6fa05a6

10 files changed

Lines changed: 578 additions & 6 deletions

File tree

doc/changelog.d/5966.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Move It extension

doc/source/User_guide/extensions.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ They are small automated workflows with a simple GUI.
153153
Generate object and surface conforming point clouds.
154154

155155

156+
.. grid-item-card:: Move it
157+
:link: pyaedt_extensions_doc/hfss/move_it
158+
:link-type: doc
159+
:margin: 2 2 0 0
160+
161+
From a line generate the parameters needed to simulate a trajectory.
162+
163+
156164
Icepak extensions
157165
~~~~~~~~~~~~~~~~~
158166

doc/source/User_guide/pyaedt_extensions_doc/hfss/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,11 @@ HFSS extensions
3232
:margin: 2 2 0 0
3333

3434
Generate and import point list from a geometry in HFSS.
35+
36+
37+
.. grid-item-card:: Move it
38+
:link: move_it
39+
:link-type: doc
40+
:margin: 2 2 0 0
41+
42+
From a line generate the parameters needed to simulate a trajectory.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Move it
2+
=======
3+
4+
With this extension, you can generate from a line a parametrize design to simulate a trajectory.
5+
6+
You can access the extension from the icon created on the **Automation** tab using the Extension Manager.
7+
8+
The following image shows the extension user interface:
9+
10+
.. image:: ../../../_static/extensions/move_it_ui.png
11+
:width: 800
12+
:alt: Move it UI
13+
14+
You can also launch the extension user interface from the terminal. An example can be found here:
15+
16+
17+
.. toctree::
18+
:maxdepth: 2
19+
20+
../commandline
10.5 KB
Loading

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

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3605,13 +3605,15 @@ def imprint_vector_projection(
36053605
return self._imprint_projection(assignment, keep_originals, False, vector_points, distance)
36063606

36073607
@pyaedt_function_handler(theList="assignment")
3608-
def purge_history(self, assignment):
3608+
def purge_history(self, assignment, non_model=False):
36093609
"""Purge history objects from object names.
36103610
36113611
Parameters
36123612
----------
36133613
assignment : list
36143614
List of object names to purge.
3615+
non_model : bool, optional
3616+
Convert new parts to non-model objects. The default is ``False``.
36153617
36163618
Returns
36173619
-------
@@ -3621,10 +3623,21 @@ def purge_history(self, assignment):
36213623
References
36223624
----------
36233625
>>> oEditor.PurgeHistory
3626+
3627+
Examples
3628+
--------
3629+
>>> from ansys.aedt.core import Hfss
3630+
>>> app = Hfss()
3631+
>>> cylinder1 = hfss.modeler.create_cylinder(orientation="X", origin=[5, 0, 0], radius=1, height=20)
3632+
>>> aedtapp.modeler.purge_history(assignment=cylinder1)
36243633
"""
36253634
szList = self.convert_to_selections(assignment)
36263635

3627-
vArg1 = ["NAME:Selections", "Selections:=", szList, "NewPartsModelFlag:=", "Model"]
3636+
new_parts = "NonModel"
3637+
if not non_model:
3638+
new_parts = "Model"
3639+
3640+
vArg1 = ["NAME:Selections", "Selections:=", szList, "NewPartsModelFlag:=", new_parts]
36283641

36293642
self.oeditor.PurgeHistory(vArg1)
36303643
return True
@@ -4269,13 +4282,15 @@ def create_object_list(self, assignment, name=None):
42694282
return False
42704283

42714284
@pyaedt_function_handler(objectname="assignment")
4272-
def generate_object_history(self, assignment):
4285+
def generate_object_history(self, assignment, non_model=False):
42734286
"""Generate history for the object.
42744287
42754288
Parameters
42764289
----------
42774290
assignment : str
42784291
Name of the history object.
4292+
non_model : bool, optional
4293+
Convert new parts to non-model objects. The default is ``False``.
42794294
42804295
Returns
42814296
-------
@@ -4285,10 +4300,23 @@ def generate_object_history(self, assignment):
42854300
References
42864301
----------
42874302
>>> oEditor.GenerateHistory
4303+
4304+
Examples
4305+
--------
4306+
>>> from ansys.aedt.core import Hfss
4307+
>>> app = Hfss()
4308+
>>> cylinder1 = hfss.modeler.create_cylinder(orientation="X", origin=[5, 0, 0], radius=1, height=20)
4309+
>>> aedtapp.modeler.purge_history(assignment=cylinder1)
4310+
>>> aedtapp.modeler.generate_object_history(assignment=cylinder1)
42884311
"""
42894312
assignment = self.convert_to_selections(assignment)
4313+
4314+
new_parts = "NonModel"
4315+
if not non_model:
4316+
new_parts = "Model"
4317+
42904318
self.oeditor.GenerateHistory(
4291-
["NAME:Selections", "Selections:=", assignment, "NewPartsModelFlag:=", "Model", "UseCurrentCS:=", True]
4319+
["NAME:Selections", "Selections:=", assignment, "NewPartsModelFlag:=", new_parts, "UseCurrentCS:=", True]
42924320
)
42934321
self.cleanup_objects()
42944322
return True
821 Bytes
Loading

0 commit comments

Comments
 (0)