Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:linetypefile [2015/09/14] (current)
Line 1: Line 1:
 +====== Locating Rhino'​s Linetype File ======
 +> **Developer:​** //​[[developer:​dotnetplugins|.NET]]//​
 +> **Summary:​** //​Demonstrates how to locate Rhino'​s default linetype file.//
 +
 +===== Question =====
 +Is there a way to get the path and filename of the Rhino'​s language-specific default linetype file?
 +
 +===== Answer =====
 +Yes, see the following example.
 +
 +==== C# ====
 +<code c#>
 +public override IRhinoCommand.result RunCommand(IRhinoCommandContext context)
 +{
 +  MRhinoProfileContext pc = RhUtil.RhinoApp().GetRhinoProfileContext(
 +    IRhinoProfileContext.context_location.cl_build_date_local_machine
 +    );
 +
 +  uint lcid = RhUtil.RhinoApp().AppSettings().AppearanceSettings().m_language_identifier;​
 +  if (0 == lcid)
 +    lcid = 1033;
 +
 +  string section = string.Format("​{0}",​ lcid);
 +  string entry = "​Default Linetype List";
 +  string value = "";​
 +  pc.LoadProfileString(section,​ entry, ref value);
 +
 +  RhUtil.RhinoApp().Print(string.Format("​{0} = {1}\n",​ entry, value));
 +
 +  return IRhinoCommand.result.success;​
 +}
 +</​code>​
 +
 +\\
 +
 +{{tag>​Developer dotnet}}
  
developer/linetypefile.txt ยท Last modified: 2015/09/14 (external edit)