Skip to content

Commit ba8447b

Browse files
Convert to md format
01-Modeling-setup
1 parent 5f3f656 commit ba8447b

File tree

2 files changed

+99
-137
lines changed

2 files changed

+99
-137
lines changed

Diff for: examples/01-Modeling-Setup/Configurations.py

+40-52
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,42 @@
1-
"""
2-
General: configuration files
3-
----------------------------
4-
This example shows how you can use PyAEDT to export configuration files and re-use
5-
them to import in a new project. A configuration file is supported by these applications:
6-
7-
* HFSS
8-
* 2D Extractor and Q3D Extractor
9-
* Maxwell
10-
* Icepak (in AEDT)
11-
* Mechanical (in AEDT)
12-
13-
The following sections are covered:
14-
15-
* Variables
16-
* Mesh operations (except Icepak)
17-
* Setup and optimetrics
18-
* Material properties
19-
* Object properties
20-
* Boundaries and excitations
21-
22-
When a boundary is attached to a face, the tool tries to match it with a
23-
``FaceByPosition`` on the same object name on the target design. If, for
24-
any reason, this face position has changed or the object name in the target
25-
design has changed, the boundary fails to apply.
26-
"""
1+
# # General: configuration files
2+
#
3+
# This example shows how you can use PyAEDT to export configuration files and re-use
4+
# them to import in a new project. A configuration file is supported by these applications:
5+
#
6+
# * HFSS
7+
# * 2D Extractor and Q3D Extractor
8+
# * Maxwell
9+
# * Icepak (in AEDT)
10+
# * Mechanical (in AEDT)
11+
#
12+
# The following sections are covered:
13+
#
14+
# * Variables
15+
# * Mesh operations (except Icepak)
16+
# * Setup and optimetrics
17+
# * Material properties
18+
# * Object properties
19+
# * Boundaries and excitations
20+
#
21+
# When a boundary is attached to a face, the tool tries to match it with a
22+
# ``FaceByPosition`` on the same object name on the target design. If, for
23+
# any reason, this face position has changed or the object name in the target
24+
# design has changed, the boundary fails to apply.
2725

28-
###############################################################################
2926
# Perform required imports
3027
# ~~~~~~~~~~~~~~~~~~~~~~~~
3128
# Perform required imports from PyAEDT.
3229

3330
import os
3431
import pyaedt
3532

36-
###############################################################################
3733
# Set non-graphical mode
3834
# ~~~~~~~~~~~~~~~~~~~~~~
3935
# Set non-graphical mode.
4036
# You can set ``non_graphical`` either to ``True`` or ``False``.
4137

4238
non_graphical = False
4339

44-
###############################################################################
4540
# Open project
4641
# ~~~~~~~~~~~~
4742
# Download the project, open it, and save it to the temporary folder.
@@ -52,26 +47,23 @@
5247
new_desktop_session=True, non_graphical=non_graphical)
5348
ipk.autosave_disable()
5449

55-
###############################################################################
56-
# Create source blocks
57-
# ~~~~~~~~~~~~~~~~~~~~
50+
# ## Create source blocks
51+
#
5852
# Create a source block on the CPU and memories.
5953

6054
ipk.create_source_block(object_name="CPU", input_power="25W")
6155
ipk.create_source_block(object_name=["MEMORY1", "MEMORY1_1"], input_power="5W")
6256

63-
###############################################################################
64-
# Assign boundaries
65-
# ~~~~~~~~~~~~~~~~~
57+
# ## Assign boundaries
58+
#
6659
# Assign the opening and grille.
6760

6861
region = ipk.modeler["Region"]
6962
ipk.assign_openings(air_faces=region.bottom_face_x.id)
7063
ipk.assign_grille(air_faces=region.top_face_x.id, free_area_ratio=0.8)
7164

72-
###############################################################################
73-
# Create setup
74-
# ~~~~~~~~~~~~
65+
# ## Create setup
66+
#
7567
# Create the setup. Properties can be set up from the ``setup`` object
7668
# with getters and setters. They don't have to perfectly match the property
7769
# syntax.
@@ -83,9 +75,8 @@
8375
setup1["Solver Type Temperature"] = "flex"
8476
ipk.save_project(r"C:\temp\Graphic_card.aedt")
8577

86-
###############################################################################
87-
# Export project to step file
88-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~
78+
# ## Export project to step file
79+
#
8980
# Export the current project to the step file.
9081

9182
filename = ipk.design_name
@@ -94,34 +85,31 @@
9485
removed_objects=[])
9586

9687
###############################################################################
97-
# Export configuration files
98-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
88+
# ## Export configuration files
89+
#
9990
# Export the configuration files. You can optionally disable the export and
10091
# import sections.
10192

10293
conf_file = ipk.configurations.export_config()
10394
ipk.close_project()
10495

105-
###############################################################################
106-
# Create project
107-
# ~~~~~~~~~~~~~~
96+
# ## Create project
97+
#
10898
# Create an Icepak project and import the step.
10999

110100
app = pyaedt.Icepak(projectname="new_proj_Ipk")
111101
app.modeler.import_3d_cad(file_path)
112102

113-
###############################################################################
114-
# Import and apply configuration file
115-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
103+
# ## Import and apply configuration file
104+
#
116105
# Import and apply the configuration file. You can apply all or part of the
117106
# JSON file that you import using options in the ``configurations`` object.
118107

119108
out = app.configurations.import_config(conf_file)
120109
app.configurations.results.global_import_success
121110

122-
###############################################################################
123-
# Close project
124-
# ~~~~~~~~~~~~~
111+
# ## Close project
112+
#
125113
# Close the project.
126114

127115
app.release_desktop()

0 commit comments

Comments
 (0)