Language resources are not parsed properly for Revit 2018

Language resources are not parsed properly for Revit 2018

Anonymous
Not applicable
279 Views
1 Reply
Message 1 of 2

Language resources are not parsed properly for Revit 2018

Anonymous
Not applicable

An ordinary application that only needs regional language settings to work properly.

 

Command code:

 

 

 

 

    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class Command : BaseCommand
    {
        private FamilyTreeForm form;

        protected override void Execute(ElementSet elements)
        {
            CultureInfo.DefaultThreadCurrentCulture = new CultureInfo(Resources.Language);
            CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo(Resources.Language);

            form = new FamilyTreeForm(doc, mainHandle);
            form.ShowDialogPlus();
        }
    }

 

 

 

 

Addin file:

 

 

 

 

   <AddIn Type="Command">
      <Assembly>FamilyTree\FamilyTree.dll</Assembly>
      <ClientId>86317968-1B3F-4E8F-942E-0F4510BB5BC4</ClientId>
      <FullClassName>Tom.FamilyTree.Command</FullClassName>
      <Text>FamilyTree</Text>
      <VisibilityMode>AlwaysVisible</VisibilityMode>
      <LanguageType>Unknown</LanguageType>
      <VendorId>TOM</VendorId>
      <VendorDescription></VendorDescription>
  </AddIn>

 

 

 

In addition, post submission insert code block is always more than a lot of useless empty lines, and also very bad control, I hope the official can repair a little.

Accepted solutions (1)
280 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

 

 

 

 

    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class Command : BaseCommand
    {
        protected override void Execute(ElementSet elements)
        {
            Resources.Culture = new CultureInfo(Resources.Language);
            new FlatMessageForm(Resources.Dir_Export, mainHandle).ShowDialogPlus();
        }
    }

 

 

 

 

It is only useful for normal resource file settings. If it depends on another dll, then this setup is meaningless, especially for form resources this way is not feasible at all, because of the number and complexity.

 

I hope Autodesk can give a reasonable multilingual solution. NET can guarantee that everything behaves correctly for multilingualism, I'm pretty sure of that already.

 

Steps to reproduce.
1. you can write a base dll containing a base class form that does the multilingual setting.
2. then write a revit plugin to contain a form that goes to inherit the base class form.
3. finally set the regional language settings

You will then find that your multilanguage setting is futile and Revit will not perform well for it. Unless you specify, in a very silly way, what region is used for each resource language. That way is silly and pointless. I've already stated above that it suffers from shortcomings and is basically unfeasible.

 

Here are the latest discussions:

https://forums.autodesk.com/t5/revit-api-forum/issue-with-languagetype-in-addin-manifest-for-localiz...

 

I seem to have made a closer to the correct answer in this discussion thread. There is still a doubt in there, LanguageType seems to be just a text identifier and seems to have no real value in sight.

0 Likes