Hi @mike, first of all I would like to remind you to read and use the Q&A functionnality.
Regarding your question, here is an example of a basic GeDialog, which make use to SetFloat to define a range.
import c4d
class MonDlg( c4d.gui.GeDialog):
idSlider = 1000
idButton = 1001
# Create the Layout
def CreateLayout(self):
self.AddEditSlider(self.idSlider, c4d.BFH_SCALE|c4d.BFV_SCALE, initw=100, inith=20)
self.AddButton(self.idButton, c4d.BFH_SCALE|c4d.BFV_SCALE, initw=100, inith=20,name = 'Get Value')
return True
# Called after CreateLayout
def InitValues(self):
self.SetFloat(self.idSlider, 0.25, min=0.0, max=1.0, step=0.01, min2=0.0, max2=0.0)
return True
# Called for each interaction from a widget
def Command(self, id, msg):
if id == self.idButton:
print self.GetFloat(self.idSlider)
return True
def main():
dlg = MonDlg()
dlg.Open(c4d.DLG_TYPE_MODAL)
if __name__=='__main__':
main()
If you have any questions please let me know.
Cheers,
Maxime!