CityEngine SDK 的 Python 绑定


PyPRT 为 CityEngine 的 PRT(程序运行时)提供 Python 绑定。这允许在 Python 中执行 CityEngine CGA 规则。使用 PyPRT,大大简化了 Python 中 3D 内容的生成。

Vitruvio is a plugin for Unreal Engine (UE). It enables the use of CityEngine CGA rules for the generation of procedural buildings in the Unreal Editor or at runtime.

About PyPRT

Python 开发人员、数据科学家或 GIS 分析师等用户可以有效地利用 CityEngine 规则包 (RPK) 来创建存储为 Python 数据结构的 3D 几何图形,或以其他格式(如 OBJ、Scene层包,…)。给定要应用 CGA 规则的初始几何图形,3D 生成在 Python(Python 脚本、Jupyter Notebook 等)中按程序完成。这允许高效和可定制的几何生成。例如,在对建筑物建模时,PyPRT 用户可以通过更改 CGA 规则输入属性的值来轻松更改生成建筑物的参数(如高度或形状)。

PyPRT 3D 内容生成基于在 CityEngine 中编写的 CGA 规则包 (RPK)。RPK 包含定义形状转换的 CGA 规则文件以及补充资产。RPK 示例可以在下面找到并直接在 PyPRT 中使用。

PyPRT 允许在多个初始几何图形上生成 3D 模型。不同的输入属性可以应用于这些初始形状中的每一个。此外,输出 3D 几何图形既可以在 Python 中使用,也可以通过使用其中一个内置 PRT 编码器导出为另一种格式。

PyPRT 可免费用于个人、教育和非商业用途。商业用途需要至少一个安装在组织中的最新 CityEngine 版本的商业许可证。除非明确允许,否则不允许再分发或提供网络服务。有关更详细的许可信息,请参阅下面的许可部分。

PyPRT Licensing Information

  • PyPRT is free for personal, educational, and non-commercial use. Commercial use requires at least one commercial license of the latest CityEngine version installed in the organization. Redistribution or web service offerings are not allowed unless expressly permitted.
  • PyPRT is under the same license as the included CityEngine SDK.
  • All content in the “Examples” directory/section is licensed under the APACHE 2.0 license. You may obtain a copy of this license at
  • For questions or enquiries, please contact

For questions or enquiries regarding licensing, please contact

ESRI  : ArcGIS CityEngine  

Downloads and Resources


Simply run pip install pyprt in your desired Python environment or conda install -c esri pyprt in a Conda environment. Then use import pyprt in your scripts.


→ 安装文档


A full documentation of PyPRT is available on our github repository.

在github 存储库中提供了 PyPRT 的完整文档。

→ Read documentation


For more information, assets and resources check our Github repository.

有关更多信息、资产和资源,请查看我们的 Github 存储库。

→ Go to Github


3D Model Optimization

This example tries to answer the following question: given the architectural design of a building (defined by a CGA rule) and a parcel, which values for the building parameters should we choose in order to maximize the green potential of the building?

→ Link to the example notebook→ ArcGIS Notebooks and PyPRT (Instruction)

3D GIS Content Creation

This example presents a possible workflow consisting of collecting and selecting city parcels, and populating them with procedurally generated trees. To do so, PyPRT is used in combination with other Python libraries, e.g. the ArcGIS API for Python.

→ Link to the example notebook→ ArcGIS Notebooks and PyPRT (Instruction)

Other Examples and blog entries

Other examples of PyPRT usage are located in the pyprt-examples Github repo. Ready-to-use rule packages and initial shapes are available there.

→ More Examples→ Generating 3D content in Python: PyPRT, a new Python library→ Converting 3D geometry formats made simple using PyPRT