Skip to content

Commit f52eb6c

Browse files
Samuelopez-ansyspyansys-ci-botSMoraisAnsys
authored
FIX: Choke designer issues (#5915)
Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: Sébastien Morais <[email protected]>
1 parent c82ca70 commit f52eb6c

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

doc/changelog.d/5915.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Choke designer issues

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,7 +2957,7 @@ def duplicate_around_axis(
29572957
Coordinate system axis or the Application.AXIS object.
29582958
angle : float, optional
29592959
Angle rotation in degees. The default is ``90``.
2960-
clones : int, optional
2960+
clones : int or str, optional
29612961
Number of clones. The default is ``2``.
29622962
create_new_objects :
29632963
Whether to create the copies as new objects. The
@@ -2978,6 +2978,8 @@ def duplicate_around_axis(
29782978
selections = self.convert_to_selections(assignment)
29792979

29802980
vArg1 = ["NAME:Selections", "Selections:=", selections, "NewPartsModelFlag:=", "Model"]
2981+
if isinstance(clones, float):
2982+
clones = int(clones)
29812983
vArg2 = [
29822984
"NAME:DuplicateAroundAxisParameters",
29832985
"CreateNewObjects:=",
@@ -2987,7 +2989,7 @@ def duplicate_around_axis(
29872989
"AngleStr:=",
29882990
self._app.value_with_units(angle, "deg"),
29892991
"Numclones:=",
2990-
str(int(clones)),
2992+
str(clones),
29912993
]
29922994
vArg3 = ["NAME:Options", "DuplicateAssignments:=", duplicate_assignment]
29932995
self.add_new_objects()

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2543,7 +2543,7 @@ def create_choke(self, input_file):
25432543
self.logger.info("Creating triple winding")
25442544
else:
25452545
list_object = self._make_winding(
2546-
name_wind, material_wind, in_rad_wind, out_rad_wind, height_wind, teta, turns, chamf, sep_layer
2546+
name_wind, material_wind, in_rad_wind, out_rad_wind, height_wind, teta, int(turns), chamf, sep_layer
25472547
)
25482548
self.logger.info("Creating single winding")
25492549
list_duplicated_object = []

src/ansys/aedt/core/workflows/hfss/choke_designer.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,15 @@ def main(extension_args):
368368
# Create choke geometry
369369
list_object = hfss.modeler.create_choke(str(json_path))
370370

371+
if not list_object: # pragma: no cover
372+
app.logger.error("No object associated to chocke creation.")
373+
if temp_dir.exists():
374+
shutil.rmtree(temp_dir, ignore_errors=True)
375+
376+
if not extension_args["is_test"]: # pragma: no cover
377+
app.release_desktop(False, False)
378+
return False
379+
371380
# Get winding objects
372381
first_winding_list = list_object[2]
373382

0 commit comments

Comments
 (0)