SBR+: Import Geometry from Maps#

This example shows how you can use PyAEDT to create an HFSS SBR+ project from an OpenStreeMaps.

Perform required imports#

Perform required imports and set up the local path to the PyAEDT directory path.

import os
from pyaedt import Hfss

Set AEDT version#

Set AEDT version.

aedt_version = "2024.1"

Set non-graphical mode#

Set non-graphical mode. You can set non_graphical either to True or False.

non_graphical = False

Define designs#

Define two designs, one source and one target. Each design is connected to a different object.

app = Hfss(
    designname="Ansys",
    solution_type="SBR+",
    specified_version=aedt_version,
    new_desktop_session=True,
    non_graphical=non_graphical
)

Define Location to import#

Define latitude and longitude to import.

ansys_home = [40.273726, -80.168269]

Generate map and import#

Assign boundaries.

app.modeler.import_from_openstreet_map(ansys_home,
                                       terrain_radius=250,
                                       road_step=3,
                                       plot_before_importing=False,
                                       import_in_aedt=True)
C:\actions-runner\_work\pyaedt\pyaedt\testenv\lib\site-packages\pyvista\core\filters\poly_data.py:2933: PyVistaFutureWarning: The default value of the ``capping`` keyword argument will change in a future version to ``True`` to match the behavior of VTK. We recommend passing the keyword explicitly to prevent future surprises.
  warnings.warn(
C:\actions-runner\_work\pyaedt\pyaedt\testenv\lib\site-packages\osmnx\graph.py:106: FutureWarning: The clean_periphery argument has been deprecated and will be removed in the v2.0.0 release. Future behavior will be as though clean_periphery=True.
  G = graph_from_polygon(

{'name': 'default', 'version': 1, 'type': 'environment', 'center_lat_lon': [40.273726, -80.168269], 'radius': 250, 'include_buildings': True, 'include_roads': True, 'parts': {'terrain': {'file_name': 'C:/Users/ansys/Documents/Ansoft/Project8.pyaedt\\Ansys/terrain.stl', 'color': 'brown', 'material': 'earth'}, 'buildings': {'file_name': 'C:/Users/ansys/Documents/Ansoft/Project8.pyaedt\\Ansys\\buildings.stl', 'color': 'grey', 'material': 'concrete'}, 'roads': {'file_name': 'C:/Users/ansys/Documents/Ansoft/Project8.pyaedt\\Ansys\\roads.stl', 'color': 'black', 'material': 'asphalt'}}}

Plot model#

Plot the model.

plot_obj = app.plot(show=False, plot_air_objects=True)
plot_obj.background_color = [153,203,255]
plot_obj.zoom = 1.5
plot_obj.show_grid = False
plot_obj.show_axes = False
plot_obj.bounding_box = False
plot_obj.plot(os.path.join(app.working_directory, "Source.jpg"))
SBR City Import
True

Release AEDT#

Release AEDT and close the example.

app.release_desktop()
True

Total running time of the script: (1 minutes 20.953 seconds)

Gallery generated by Sphinx-Gallery