Calculate density per layer
This script calculates the density of a specified range per layer for all layers.
Download here. (calc_density_per_layer.py)
Script
# Specify the following
filepath = "/path/to/input"
calc_area = (0,0,10,10)
# Open file and get layers
input = pynebv.file.open(filepath)
layers = input.layers()
# Hide all layers once
for layer in layers:
layer.display = False
# Calculate density for each layer
print("Input Data : " + filepath)
print("Calculation Area : " + str(calc_area))
print("-------------------")
for layer in layers:
layer.display = True
density = pynebv.calculation.density(calc_area)
density_val = density.props()['Density']
layno = layer.name
print(layno + " : " + density_val + "%")
layer.display = False
print("-------------------")
How to Use
$ nebv --python-file /path/to/script.py
Results
Output File
None
Console
Input Data : /path/to/input
Calculation Area : <Area Result>
-------------------
<layno> : <val> %
<layno> : <val> %
<layno> : <val> %
...
-------------------
Last modified August 18, 2026