Programming examples
Scripts and commands described here are in the GitHub repository ComandosDigi3DPython.
Run them in two ways:
- As commands: enter the file name without
.pyon the command line. Commands with parameters useNOMBRE=parámetro1 parámetro2 .... Digi3D.AI installs them inOrdenesPythonunder its installation folder. To modify one, copy its.pyto your macro directory and edit that copy, which takes precedence. Python commands from ComandosDigi3DPython lists search folders and summarizes each command. - Paste or open a script in the Python script pane. This method supports only scripts without parameters.
Each page shows complete code and explains it step by step. Each group progresses from easier to harder examples.
Missing parameters or invalid numbers cause the command to play the error sound and display the reason and usage.
Scripts without parameters
Commands with parameters
- Transforming complexes into points
- Rounding contour Z elevations
- Creating tasks for small areas
- Connecting nearby contours
- Deleting contours by interval
- Filtering intermediate and index contours
- Renaming a code while retaining attributes
Interactive commands
- Text from the Cadastre street directory
- Text from Azure Maps (parameter: Azure Maps key)
- Prefixing the selected geometry's codes (parameter: prefix)
Digi3D.AI's embedded interpreter provides only the standard library, without third-party packages such as
numpyorrequests. Web service examples useurllib.request, which belongs to the standard library.