Skip to content

Commit eee5782

Browse files
authored
Added method to bend flex (#1230)
* Added method to bend flex * Added method to bend flex Co-authored-by: maxcapodi78 <Shark78>
1 parent eba23d1 commit eee5782

File tree

4 files changed

+27
-0
lines changed

4 files changed

+27
-0
lines changed
44.4 KB
Binary file not shown.

_unittest/test_41_3dlayout_modeler.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616

1717
# Input Data and version for the test
1818
test_project_name = "Test_RadioBoard"
19+
test_rigid_flex = "demo_flex"
1920

2021

2122
class TestClass(BasisTest, object):
2223
def setup_class(self):
2324
BasisTest.my_setup(self)
2425
self.aedtapp = BasisTest.add_app(self, project_name=test_project_name, application=Hfss3dLayout)
2526
self.hfss3dl = BasisTest.add_app(self, project_name="differential_pairs", application=Hfss3dLayout)
27+
self.flex = BasisTest.add_app(self, project_name=test_rigid_flex, application=Hfss3dLayout)
2628
example_project = os.path.join(local_path, "example_models", "Package.aedb")
2729
self.target_path = os.path.join(self.local_scratch.path, "Package_test_41.aedb")
2830
self.local_scratch.copyfolder(example_project, self.target_path)
@@ -496,6 +498,12 @@ def test_39_import_ipc(self):
496498
aedb_file = os.path.join(self.local_scratch.path, "dxf_out.aedb")
497499
assert self.aedtapp.import_ipc2581(dxf_file, aedb_path=aedb_file, control_file="")
498500

501+
@pytest.mark.skipif(config["desktopVersion"] < "2022.2", reason="Not working on AEDT 22R1")
502+
def test_40_test_flex(self):
503+
assert self.flex.enable_rigid_flex()
504+
assert self.flex.enable_rigid_flex()
505+
pass
506+
499507
@pytest.mark.skipif(os.name == "posix", reason="Bug on linux")
500508
def test_90_set_differential_pairs(self):
501509
assert self.hfss3dl.set_differential_pair(

pyaedt/hfss3dlayout.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from pyaedt.application.Analysis3DLayout import FieldAnalysis3DLayout
1010
from pyaedt.generic.general_methods import generate_unique_name
1111
from pyaedt.generic.general_methods import pyaedt_function_handler
12+
from pyaedt import settings
1213

1314

1415
class Hfss3dLayout(FieldAnalysis3DLayout):
@@ -1564,3 +1565,20 @@ def export_3d_model(self, file_name=None, path=None, extension="sat"):
15641565
["NAME:options", "FileName:=", os.path.join(path, "{}.{}".format(file_name, extension))]
15651566
)
15661567
return True
1568+
1569+
@pyaedt_function_handler()
1570+
def enable_rigid_flex(self):
1571+
"""Enable/Disable the rigid flex of a board with bending if available.
1572+
This command is the same for both, enable and disable rigid flex.
1573+
1574+
Returns
1575+
-------
1576+
bool
1577+
"""
1578+
if settings.aedt_version >= "2022.2":
1579+
self.modeler.oeditor.ProcessBentModelCmd()
1580+
if self.modeler.rigid_flex == True:
1581+
self.modeler.rigid_flex = False
1582+
self.modeler.rigid_flex = True
1583+
return True
1584+
return False

pyaedt/modeler/Model3DLayout.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def __init__(self, app):
5151
self.o_def_manager = self._app.odefinition_manager
5252
self.o_component_manager = self.o_def_manager.GetManager("Component")
5353
self.o_model_manager = self.o_def_manager.GetManager("Model")
54+
self.rigid_flex = None
5455
pass
5556

5657
@property

0 commit comments

Comments
 (0)