Python Panel

Python Panel
You can execute Python scripts and manipulate neoEBV.

The Python Panel consists of a Script Box for entering scripts and a Console Box to display script execution results.

Python Panel Toolbar

Python Panel Toolbar

Button

Icon Item Action
Run Executes the script entered in the Script Box.
Clear Console Before Run If it is ON, clears the Console Box before executing Run.
Clear Console Clears the content of the Console Box.
Load Script File Opens a dialog to load a script from a file into the Script Box.
Save Script File Opens a dialog to save the content of the Script Box to a file.
Python Displays the Python Panel menu.

Argument Box

Python Panel Argument Box

Specifies arguments to be passed to the script at script runtime. The input string is interpreted as a space-separated list of runtime arguments. A space enclosed in "" is not interpreted as a delimiter.

Arguments specified in the Argument Box can be used in scripts by importing the sys module. argv[0] contains the string “ScriptBox”. The specified arguments can be accessed from argv[1] and more in the order specified.

import sys
# "ScriptBox"
print(sys.argv[0])
# The first argument specified
print(sys.argv[1])
Menu Action
Run Executes the script entered in the Script Box.
Clear Console Before Run If it is ON, clears the Console Box before executing Run.
Clear Console Clears the content of the Console Box.
Load Script File Opens a dialog to load a script from a file into the Script Box.
Save Script File Opens a dialog to save the content of the Script Box to a file.
Float Panel Floats the panel.
Close Panel Closes the panel.

Sample Code

Access to the neoEBV process is enabled through the pynebv module. Since the pynebv module is already imported, ‘import pynebv’ is not needed to be written.

# Open a file and set the display state for each layer
chip = pynebv.file.open('/path/to/file.oas')
# Operations for multiple layers together
layers = chip.layers()
layers.color = 'Red'
# Operations specifying the layer number
chip.layer(1).color = 'Blue'
chip.layer(2).bold = True
chip.layer(3).fade = False
chip.layer(4).outline = False
# Operations at the chip level
chip.hatch = 'vertical'

# Create a mark called 'Mark1' and use the middle-sized thumbnail
mark = pynebv.mark.add((100,100), "Mark1")
mark.thumbnail_image_size = "Middle"

# Change the screen's display area
pynebv.screen.area((90,90,110,100))

# Make file names containing the string 'error' red and bold
errorChips = pynebv.file.items('*error*')
if len(errorChips) > 0:
  errorChips.color = 'Red'
  errorChips.bold = True

# Traverse Marks and save images
marks = pynebv.mark.items()
index = 0
for mark in marks:
  index = index + 1
  pos = mark.pos
  pynebv.screen.area((pos[0] - 10, pos[1] - 10,pos[0] + 10,pos[1] + 10))
  pynebv.screen.save_image('~/' + str(index) + '.png')

pynebv reference

Please refer to the pynebv Reference page.


Sample Files

Introducing sample Python script files.

Last modified April 2, 2025