Okay my class definition for a python object is
Code: Select all
class GDMLTube(GDMLcommon) :
def __init__(self, obj, rmin, rmax, z, startphi, deltaphi, aunit, \
lunit, material):
'''Add some custom properties to our Tube feature'''
obj.addProperty("App::PropertyLength","rmin","GDMLTube","Inside Radius").rmin=rmin
obj.addProperty("App::PropertyLength","rmax","GDMLTube","Outside Radius").rmax=rmax
obj.addProperty("App::PropertyLength","z","GDMLTube","Length z").z=z
obj.addProperty("App::PropertyFloat","startphi","GDMLTube","Start Angle").startphi=startphi
obj.addProperty("App::PropertyFloat","deltaphi","GDMLTube","Delta Angle").deltaphi=deltaphi
obj.addProperty("App::PropertyEnumeration","aunit","GDMLTube","aunit")
obj.aunit=['rad','deg']
obj.aunit=0
obj.addProperty("App::PropertyString","lunit","GDMLTube","lunit").lunit=lunit
which as it stands defaults the object aunit property to rad.
What I would like to do is set the value based on the value of aunit passed to its __init__
function