| McNeel Wiki | |||||
| edit · print · help · all topics | |||||
Main Pages
Languages
| QuestionI’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 change the position of the command prompt. When I have it on the botton, change it to the top. Do you know why? AnswerWhen making a copy if Rhino's CRhinoAppAppearanceSettings object, in order 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;
}
| ||||
| rename · changes · history · subscriptions · lost and found · references · file upload | |||||