.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples\02-SBR+\SBR_City_Import.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_02-SBR+_SBR_City_Import.py: SBR+: Import Geometry from Maps ------------------------------- This example shows how you can use PyAEDT to create an HFSS SBR+ project from an OpenStreeMaps. .. GENERATED FROM PYTHON SOURCE LINES 8-12 Perform required imports ~~~~~~~~~~~~~~~~~~~~~~~~ Perform required imports and set up the local path to the PyAEDT directory path. .. GENERATED FROM PYTHON SOURCE LINES 12-16 .. code-block:: default import os from pyaedt import Hfss .. GENERATED FROM PYTHON SOURCE LINES 17-21 Set non-graphical mode ~~~~~~~~~~~~~~~~~~~~~~ Set non-graphical mode. You can set ``non_graphical`` either to ``True`` or ``False``. .. GENERATED FROM PYTHON SOURCE LINES 21-24 .. code-block:: default non_graphical = False .. GENERATED FROM PYTHON SOURCE LINES 25-29 Define designs ~~~~~~~~~~~~~~ Define two designs, one source and one target. Each design is connected to a different object. .. GENERATED FROM PYTHON SOURCE LINES 29-38 .. code-block:: default app = Hfss( designname="Ansys", solution_type="SBR+", specified_version="2023.2", new_desktop_session=True, non_graphical=non_graphical ) .. rst-class:: sphx-glr-script-out .. code-block:: none Initializing new desktop! .. GENERATED FROM PYTHON SOURCE LINES 39-42 Define Location to import ~~~~~~~~~~~~~~~~~~~~~~~~~ Define latitude and longitude to import. .. GENERATED FROM PYTHON SOURCE LINES 42-44 .. code-block:: default ansys_home = [40.273726, -80.168269] .. GENERATED FROM PYTHON SOURCE LINES 45-48 Generate map and import ~~~~~~~~~~~~~~~~~~~~~~~ Assign boundaries. .. GENERATED FROM PYTHON SOURCE LINES 48-55 .. code-block:: default app.modeler.import_from_openstreet_map(ansys_home, terrain_radius=250, road_step=3, plot_before_importing=False, import_in_aedt=True) .. rst-class:: sphx-glr-script-out .. code-block:: none C:\actions-runner\_work\pyaedt\pyaedt\testenv\lib\site-packages\pyaedt\modeler\advanced_cad\oms.py:102: UserWarning: The `geometries` module and `geometries_from_X` functions have been renamed the `features` module and `features_from_X` functions. Use these instead. The `geometries` module and function names are deprecated and will be removed in a future release. gdf = ox.geometries.geometries_from_point(center_lat_lon, tags={"building": True}, dist=max_radius) C:\actions-runner\_work\pyaedt\pyaedt\testenv\lib\site-packages\pyvista\core\filters\poly_data.py:2951: 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:88: UserWarning: The clean_periphery argument has been deprecated and will be removed in a future 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/Project2076.pyaedt\\Ansys/terrain.stl', 'color': 'brown', 'material': 'earth'}, 'buildings': {'file_name': 'C:/Users/ansys/Documents/Ansoft/Project2076.pyaedt\\Ansys\\buildings.stl', 'color': 'grey', 'material': 'concrete'}, 'roads': {'file_name': 'C:/Users/ansys/Documents/Ansoft/Project2076.pyaedt\\Ansys\\roads.stl', 'color': 'black', 'material': 'asphalt'}}} .. GENERATED FROM PYTHON SOURCE LINES 56-59 Plot model ~~~~~~~~~~ Plot the model. .. GENERATED FROM PYTHON SOURCE LINES 59-68 .. code-block:: default 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")) .. image-sg:: /examples/02-SBR+/images/sphx_glr_SBR_City_Import_001.png :alt: SBR City Import :srcset: /examples/02-SBR+/images/sphx_glr_SBR_City_Import_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 69-72 Release AEDT ~~~~~~~~~~~~ Release AEDT and close the example. .. GENERATED FROM PYTHON SOURCE LINES 72-74 .. code-block:: default app.release_desktop() .. rst-class:: sphx-glr-script-out .. code-block:: none True .. rst-class:: sphx-glr-timing **Total running time of the script:** (1 minutes 14.949 seconds) .. _sphx_glr_download_examples_02-SBR+_SBR_City_Import.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: SBR_City_Import.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: SBR_City_Import.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_