|
17 | 17 | # Set constant values
|
18 | 18 |
|
19 | 19 | AEDT_VERSION = "2024.1"
|
20 |
| - |
21 |
| -# ## Set non-graphical mode |
22 |
| -# |
23 |
| -# Set non-graphical mode. |
24 |
| -# You can set ``non_graphical`` either to ``True`` or ``False``. |
25 |
| - |
26 |
| -non_graphical = False |
| 20 | +NG_MODE = False # Open Electronics UI when the application is launched. |
27 | 21 |
|
28 | 22 | # ## Create temporary directory
|
29 | 23 |
|
|
38 | 32 | #
|
39 | 33 | # Launch HFSS and open the project.
|
40 | 34 |
|
41 |
| -project_name = pyaedt.generate_unique_project_name(rootname=temp_dir.name, project_name="doppler") |
| 35 | +project_name = os.path.join(temp_dir.name, "doppler.aedt") |
42 | 36 | app = pyaedt.Hfss(
|
43 | 37 | version=AEDT_VERSION,
|
44 | 38 | solution_type="SBR+",
|
45 | 39 | new_desktop=True,
|
46 | 40 | project=project_name,
|
47 | 41 | close_on_exit=True,
|
48 |
| - non_graphical=non_graphical, |
| 42 | + non_graphical=NG_MODE, |
49 | 43 | )
|
50 | 44 |
|
| 45 | +# Creation of the "actors" in the scene is comprised of many editing steps. Disabling the "autosave" option helps |
| 46 | +# avoids delays that occur while the project is being saved. |
| 47 | + |
51 | 48 | app.autosave_disable()
|
52 | 49 |
|
53 | 50 | # ## Save project and rename design
|
|
60 | 57 |
|
61 | 58 | # ## Set up library paths
|
62 | 59 | #
|
63 |
| -# Set up library paths to 3D components. |
| 60 | +# Specify the location of 3D components used to create the scene. |
64 | 61 |
|
65 | 62 | actor_lib = os.path.join(library_path, "actor_library")
|
66 | 63 | env_lib = os.path.join(library_path, "environment_library")
|
|
75 | 72 | #
|
76 | 73 | # Define the background environment.
|
77 | 74 |
|
78 |
| -road1 = app.modeler.add_environment(env_folder=env_folder, environment_name="Bari") |
| 75 | +road1 = app.modeler.add_environment(input_dir=env_folder, name="Bari") |
79 | 76 | prim = app.modeler
|
80 | 77 |
|
81 | 78 | # ## Place actors
|
|
84 | 81 | # in the environment.
|
85 | 82 |
|
86 | 83 | person1 = app.modeler.add_person(
|
87 |
| - actor_folder=person_folder, speed=1.0, global_offset=[25, 1.5, 0], yaw=180, actor_name="Massimo" |
| 84 | + input_dir=person_folder, |
| 85 | + speed=1.0, |
| 86 | + global_offset=[25, 1.5, 0], |
| 87 | + yaw=180, |
| 88 | + name="Massimo", |
88 | 89 | )
|
89 | 90 | person2 = app.modeler.add_person(
|
90 |
| - actor_folder=person_folder, speed=1.0, global_offset=[25, 2.5, 0], yaw=180, actor_name="Devin" |
| 91 | + input_dir=person_folder, |
| 92 | + speed=1.0, |
| 93 | + global_offset=[25, 2.5, 0], |
| 94 | + yaw=180, |
| 95 | + name="Devin", |
91 | 96 | )
|
92 | 97 | car1 = app.modeler.add_vehicle(
|
93 |
| - actor_folder=car_folder, speed=8.7, global_offset=[3, -2.5, 0], actor_name="LuxuryCar" |
| 98 | + input_dir=car_folder, speed=8.7, global_offset=[3, -2.5, 0], name="LuxuryCar" |
94 | 99 | )
|
95 | 100 | bike1 = app.modeler.add_vehicle(
|
96 |
| - actor_folder=bike_folder, |
| 101 | + input_dir=bike_folder, |
97 | 102 | speed=2.1,
|
98 | 103 | global_offset=[24, 3.6, 0],
|
99 | 104 | yaw=180,
|
100 |
| - actor_name="Alberto_in_bike", |
| 105 | + name="Alberto_in_bike", |
101 | 106 | )
|
102 | 107 | bird1 = app.modeler.add_bird(
|
103 |
| - actor_folder=bird_folder, |
| 108 | + input_dir=bird_folder, |
104 | 109 | speed=1.0,
|
105 | 110 | global_offset=[19, 4, 3],
|
106 | 111 | yaw=120,
|
107 | 112 | pitch=-5,
|
108 | 113 | flapping_rate=30,
|
109 |
| - actor_name="Pigeon", |
| 114 | + name="Pigeon", |
110 | 115 | )
|
111 | 116 | bird2 = app.modeler.add_bird(
|
112 |
| - actor_folder=bird_folder, |
| 117 | + input_dir=bird_folder, |
113 | 118 | speed=1.0,
|
114 | 119 | global_offset=[6, 2, 3],
|
115 | 120 | yaw=-60,
|
116 | 121 | pitch=10,
|
117 |
| - actor_name="Eagle", |
| 122 | + name="Eagle", |
118 | 123 | )
|
119 | 124 |
|
120 | 125 | # ## Place radar
|
|
124 | 129 |
|
125 | 130 | radar1 = app.create_sbr_radar_from_json(
|
126 | 131 | radar_file=radar_lib,
|
127 |
| - radar_name="Example_1Tx_1Rx", |
| 132 | + name="Example_1Tx_1Rx", |
128 | 133 | offset=[2.57, 0, 0.54],
|
129 | 134 | use_relative_cs=True,
|
130 | 135 | relative_cs_name=car1.cs_name,
|
|
145 | 150 | # Plot the model.
|
146 | 151 |
|
147 | 152 | app.plot(
|
148 |
| - show=False, export_path=os.path.join(app.working_directory, "Image.jpg"), plot_air_objects=True |
| 153 | + show=False, |
| 154 | + export_path=os.path.join(app.working_directory, "Image.jpg"), |
| 155 | + plot_air_objects=True, |
149 | 156 | )
|
150 | 157 |
|
151 | 158 | # ## Solve and release AEDT
|
152 | 159 | #
|
153 | 160 | # Solve and release AEDT. To solve, uncomment the ``app.analyze_setup`` command
|
154 | 161 | # to activate the simulation.
|
155 | 162 |
|
| 163 | +# + |
156 | 164 | # app.analyze_setup(sweep.name)
|
| 165 | +# - |
157 | 166 |
|
158 | 167 | # ## Release AEDT
|
159 | 168 | #
|
160 | 169 | # Release AEDT and close the example.
|
161 | 170 |
|
162 | 171 | app.release_desktop()
|
163 | 172 |
|
164 |
| -# ## Clean temporary directory |
| 173 | +# ## Cleanup |
| 174 | +# |
| 175 | +# All project files are saved in the folder ``temp_dir.name``. If you've run this example as a Jupyter notebook you |
| 176 | +# can retrieve those project files. The following cell removes all temporary files, including the project folder. |
165 | 177 |
|
166 | 178 | temp_dir.cleanup()
|
0 commit comments