Hello Dale,
Thanks for the help. I have been able to get the list of options in the command window. I am still having difficulty setting and getting the document data. This is the first portion of my code. You can see I originally set it up as an optiontoggle but now that I have exceeded 2 options, I need to expand to a optionlist (for doortype). Any advice would be greatly appreciated.
def GetWP():
gp=Rhino.Input.Custom.GetPoint()
gp.SetCommandPrompt("Select Lower Work Point")
if rs.GetDocumentData("Door","sillheight"):
sillheightOption = Rhino.Input.Custom.OptionDouble(float(rs.GetDocumentData("Door","sillheight"))/rs.UnitScale(8),1/rs.UnitScale(8),100/rs.UnitScale(8)) #update values in metric(?), then converted to imperial (8)
else:
sillheightOption = Rhino.Input.Custom.OptionDouble(10/rs.UnitScale(8),1/rs.UnitScale(8),100/rs.UnitScale(8))
if rs.GetDocumentData("Door","doorheight"):
doorheightOption = Rhino.Input.Custom.OptionDouble(float(rs.GetDocumentData("Door","doorheight"))/rs.UnitScale(8),1/rs.UnitScale(8),200/rs.UnitScale(8)) #last 2 values set the bounds
else:
doorheightOption = Rhino.Input.Custom.OptionDouble(100/rs.UnitScale(8),1/rs.UnitScale(8),200/rs.UnitScale(8))
if rs.GetDocumentData("Door","doorwidth"):
doorwidthOption = Rhino.Input.Custom.OptionDouble(float(rs.GetDocumentData("Door","doorwidth"))/rs.UnitScale(8),1/rs.UnitScale(8),150/rs.UnitScale(8))
else:
doorwidthOption = Rhino.Input.Custom.OptionDouble(100/rs.UnitScale(8),1/rs.UnitScale(8),150/rs.UnitScale(8))
if rs.GetDocumentData("Door","doortype"):
if rs.GetDocumentData("Door","doortype") == "True":
doortypeOption = Rhino.Input.Custom.OptionToggle(True, "Watertight", "Weathertight")
else:
doortypeOption = Rhino.Input.Custom.OptionToggle(False,"Watertight", "Weathertight")
else:
doortypeOption = Rhino.Input.Custom.OptionToggle(True,"Watertight", "Weathertight")
if rs.GetDocumentData("Door","throw"):
if rs.GetDocumentData("Door","throw") == "True":
throwOption = Rhino.Input.Custom.OptionToggle(True, "negX","posX")
else:
throwOption = Rhino.Input.Custom.OptionToggle(False,"negX","posX")
else:
throwOption = Rhino.Input.Custom.OptionToggle(True,"negX","posX")
if rs.GetDocumentData("Door","swinghand"):
if rs.GetDocumentData("Door","swinghand") == "True":
swinghandOption = Rhino.Input.Custom.OptionToggle(True, "Left","Right")
else:
swinghandOption = Rhino.Input.Custom.OptionToggle(False, "Left","Right")
else:
swinghandOption = Rhino.Input.Custom.OptionToggle(True,"Left","Right")
if rs.GetDocumentData("Door","swingdir"):
if rs.GetDocumentData("Door","swingdir") == "True":
swingdirOption = Rhino.Input.Custom.OptionToggle(True, "Reversed","Away")
else:
swingdirOption = Rhino.Input.Custom.OptionToggle(False, "Reversed","Away")
else:
swingdirOption = Rhino.Input.Custom.OptionToggle(True,"Reversed","Away")
if rs.GetDocumentData("Door","degopen"):
degopenOption = Rhino.Input.Custom.OptionDouble(float(rs.GetDocumentData("Door","degopen")),0,180)
else:
degopenOption = Rhino.Input.Custom.OptionDouble(0,0,180)
gp.AddOptionDouble("SillHeight_"+rs.UnitSystemName(True,False,True,True), sillheightOption)
gp.AddOptionDouble("DoorHeight_"+rs.UnitSystemName(True,False,True,True), doorheightOption)
gp.AddOptionDouble("DoorWidth_"+rs.UnitSystemName(True,False,True,True), doorwidthOption)
gp.AddOptionToggle("DoorType",doortypeOption) #################################
#gp.AddOptionList("DoorType",("Weathertight","Watertight","Joiner"),0)
gp.AddOptionToggle("Throw",throwOption)
gp.AddOptionToggle("SwingHand",swinghandOption)
gp.AddOptionToggle("SwingDir",swingdirOption)
gp.AddOptionDouble("DegreeOpen",degopenOption)
while True:
get_rc = gp.Get()
if gp.CommandResult()!=Rhino.Commands.Result.Success:
return gp.CommandResult()
scriptcontext.escape_test()
if get_rc==Rhino.Input.GetResult.Point:
WP = gp.Point()
sillheight = sillheightOption.CurrentValue
rs.SetDocumentData("Door","sillheight",str(sillheight*rs.UnitScale(8)))
#doorheight = doorheightOption.CurrentValue
doorheightclear = doorheightOption.CurrentValue
rs.SetDocumentData("Door","doorheight",str(doorheightclear*rs.UnitScale(8)))
doorwidth = doorwidthOption.CurrentValue
rs.SetDocumentData("Door","doorwidth",str(doorwidth*rs.UnitScale(8)))
doortype = doortypeOption.CurrentValue
rs.SetDocumentData("Door","doortype",str(doortype))
throw = throwOption.CurrentValue
rs.SetDocumentData("Door","throw",str(throw))
swinghand = swinghandOption.CurrentValue
rs.SetDocumentData("Door","swinghand",str(swinghand))
swingdir = swingdirOption.CurrentValue
rs.SetDocumentData("Door","swingdir",str(swingdir))
degopen = degopenOption.CurrentValue
rs.SetDocumentData("Door","degopen",str(degopen))
elif get_rc==Rhino.Input.GetResult.Option:
continue
break
return WP, sillheight, doorheightclear, doorwidth, doortype, throw, swinghand, swingdir, degopen