Site Tools


Changing the Language in Rhino

Command prompt window moves when setting language

Question

I’m trying to change the language of Rhino by code:

Dim settings As MRhinoAppSettings = RhUtil.RhinoApp.AppSettings
Dim appearance As IRhinoAppAppearanceSettings = settings.AppearanceSettings()
Dim appearance2 As New MRhinoAppAppearanceSettings(appearance)
appearance2.m_language_identifier = id_lang
settings.SetAppearanceSettings(appearance2)

This code works, but it changes the position of the command prompt. When I have it on the bottom, it changes it to the top. Do you know why?

Answer

When making a copy if Rhino's CRhinoAppAppearanceSettings object, to make changes, make sure the sync_with_ui argument is set to True when calling CRhinoAppSettings::AppearanceSettings. The following examples demonstrate this:

C++

CRhinoCommand::result CCommandTest::RunCommand( const CRhinoCommandContext& context )
{
  CRhinoAppSettings& settings = RhinoApp().AppSettings();
  CRhinoAppAppearanceSettings appearance = settings.AppearanceSettings(true);
  appearance.m_language_identifier = 1034; // Spanish
  settings.SetAppearanceSettings(appearance);
  return CRhinoCommand::success;
}

C#

public override IRhinoCommand.result RunCommand(IRhinoCommandContext context)
{
  MRhinoAppSettings settings = RhUtil.RhinoApp().AppSettings();
  MRhinoAppAppearanceSettings appearance = new MRhinoAppAppearanceSettings(settings.AppearanceSettings(true));
  appearance.m_language_identifier = 1034; // Spanish
  settings.SetAppearanceSettings(appearance);
  return IRhinoCommand.result.success;
}
developer/sdksamples/language.txt · Last modified: 2016/03/22 by sandy