Skip to content

Commit

Permalink
4199 sweep along vector issue (#4250)
Browse files Browse the repository at this point in the history
* Fix issue in sweep_along_vector() when managing list of object as input.

Update UT test_47_sweep_along_vector() additional lines

* Fix issue in sweep_along_vector() when managing list of object as input.

Update UT test_47_sweep_along_vector() additional lines

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* revert unexpected change in sweep_around_axis()

* Fix docstring syntax

* Update pyaedt/modeler/cad/Primitives.py

Co-authored-by: Kathy Pippert <[email protected]>

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kathy Pippert <[email protected]>
  • Loading branch information
3 people authored Feb 21, 2024
1 parent 500ef87 commit a2b448d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
Binary file not shown.
8 changes: 8 additions & 0 deletions _unittest/test_02_3D_modeler.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,14 @@ def test_47_sweep_along_vector(self):
sweep_vector = [5, 0, 0]
rect1 = self.aedtapp.modeler.create_rectangle(self.aedtapp.PLANE.YZ, [0, 0, 0], [20, 20], "rectangle_to_vector")
assert rect1.sweep_along_vector(sweep_vector)
rect2 = self.aedtapp.modeler.create_rectangle(
self.aedtapp.PLANE.YZ, [0, 40, 0], [20, 20], "rectangle_to_vector2"
)
rect3 = self.aedtapp.modeler.create_rectangle(
self.aedtapp.PLANE.YZ, [0, 80, 0], [20, 20], "rectangle_to_vector3"
)
rect_list = [rect2, rect3]
assert self.aedtapp.modeler.sweep_along_vector(objid=rect_list, sweep_vector=sweep_vector)

def test_48_coordinate_systems_parametric(self):
self.aedtapp["var1"] = "5mm"
Expand Down
12 changes: 9 additions & 3 deletions pyaedt/modeler/cad/Primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -2863,8 +2863,8 @@ def sweep_along_vector(self, objid, sweep_vector, draft_angle=0, draft_type="Rou
Returns
-------
bool
``True`` when successful, ``False`` when failed.
:class:`pyaedt.modeler.cad.object3d.Object3d` or list of :class:`pyaedt.modeler.cad.object3d.Object3d`
One or more objects created.
References
----------
Expand All @@ -2883,7 +2883,13 @@ def sweep_along_vector(self, objid, sweep_vector, draft_angle=0, draft_type="Rou

self.oeditor.SweepAlongVector(vArg1, vArg2)

return self.update_object(objid)
if isinstance(objid, list):
updated_obj = []
for sel_obj in objid:
updated_obj.append(self.update_object(sel_obj))
return updated_obj
else:
return self.update_object(objid)

@pyaedt_function_handler()
def sweep_along_path(
Expand Down

0 comments on commit a2b448d

Please sign in to comment.