Problem.
How can I get this to work like Rhino, where the user can customize the options but still run the command, select objects etc
def get_options():
# Retrieve stored values or set to defaults
symbol_radius = get_custom_value("symbol_radius", 5)
text_height = get_custom_value("text_height", 2)
accuracy = get_custom_value("accuracy", 1) # Default to 1m
# Create option objects
symbol_radius_opt = Rhino.Input.Custom.OptionDouble(symbol_radius)
text_height_opt = Rhino.Input.Custom.OptionDouble(text_height)
accuracy_opt = Rhino.Input.Custom.OptionDouble(accuracy)
while True:
go = Rhino.Input.Custom.GetOption()
go.SetCommandPrompt("Specify options for spot coordinate (Press Enter or Right-click to confirm)")
go.AddOptionDouble("SymbolRadius", symbol_radius_opt)
go.AddOptionDouble("TextHeight", text_height_opt)
go.AddOptionDouble("Accuracy", accuracy_opt)
result = go.Get()
if result == Rhino.Input.GetResult.Option:
continue
elif result in (Rhino.Input.GetResult.Nothing, Rhino.Input.GetResult.Cancel): # Press Enter or Right-click
break
else:
return None, None, None
# Update stored values based on user input
set_custom_value("symbol_radius", symbol_radius_opt.CurrentValue)
set_custom_value("text_height", text_height_opt.CurrentValue)
set_custom_value("accuracy", accuracy_opt.CurrentValue)
return symbol_radius_opt.CurrentValue, text_height_opt.CurrentValue, accuracy_opt.CurrentValue
Basically the user wants to be able to use the command, and have this strong running on the command line so he can change it as he works, some rhino commands have this behavoir
If the user clicks on the model, then it confirms the values that are currently being used
There are many commands like this
How is it reached