The evu module
The evu module contains functions for creating an erection view (evu. AddErectionView ), determining the number erection views allocated (evu. AllocatedErectionViews ). deleting an erection view (evu. DeleteErectionView ), reading the erection views in your current Job (evu. GetErectionViews ), and opening an erection view (evu. OpenErectionView ).
# A parametric that uses the evu module.
import evu
import exceptions
import param
import Point3D
def test_evu_api():
try:
evu.AddErectionView(
'python_evu', #view name
Point3D.Point3D(), #eye
Point3D.Point3D( 0., 0., 1. ), #up
Point3D.Point3D( 0., 1., 0. ), #look_at
evu.ViewType.Primary,
12.0, #scene width
1200.0, #scene height
0., #depth near/in
24., #depth far/out
)
last_view = evu.GetErectionViews()[ -1 ]
#now delete it and try to add it a different way
evu.DeleteErectionView( last_view[ 1 ] )
evu.AddErectionView( *last_view[ 1: ] )
evu.OpenErectionView( 'python_evu' )
except exceptions.ValueError, msg:
print(msg)
if __name__ == '__main__':
try:
if 'python_evu' in [ v[ 1 ] for v in evu.GetErectionViews() ]:
if evu.DeleteErectionView( 'python_evu' ):
test_evu_api();
else:
print("Can't delete python_evu")
else:
test_evu_api();
except param.StationError, msg:
print(msg)
To get help on the evu module , use the built-in Python functions dir() and help() while at the SDS2 Python Prompt in Modeling :
SDS2 Python Prompt |
SDS2 Interactive Python Prompt
|
SDS2 Python Prompt |
>>> help(evu.AddErectionView)
AddErectionView(...)
|
SDS2 Python Prompt |
>>> help(evu.AllocatedErectionViews)
AllocatedErectionViews(...)
|
SDS2 Python Prompt |
>>> help(evu.DeleteErectionView)
DeleteErectionView(...)
|
SDS2 Python Prompt |
>>> help(evu.GetErectionViews)
GetErectionViews(...)
|
SDS2 Python Prompt |
>>> help(evu.OpenErectionView)
OpenErectionView(...)
|