Quick test,… works well.
UI.menu('View').add_item UI::Command::new('Text') {
opts = Sketchup::active_model.rendering_options
opts['DisplayText']= !opts['DisplayText']
}.set_validation_proc {
Sketchup::active_model.rendering_options['DisplayText'] ? MF_CHECKED : MF_UNCHECKED
}
UI.menu('View').add_item UI::Command::new('Dimensions') {
opts = Sketchup::active_model.rendering_options
opts['DisplayDims']= !opts['DisplayDims']
}.set_validation_proc {
Sketchup::active_model.rendering_options['DisplayDims'] ? MF_CHECKED : MF_UNCHECKED
}