Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get the localize type names in Civil3D/Map Entities?

1 REPLY 1
Reply
Message 1 of 2
moon_pelican_cat
248 Views, 1 Reply

How to get the localize type names in Civil3D/Map Entities?

I posted this question to the (vanilla) AutoCAD .Net forum.

How to get the localize type names?

https://forums.autodesk.com/t5/net/how-to-get-the-localize-type-names/td-p/12724015

The helpful answer and code was served by @ActivistInvestor. Thanks for that again.

(@ActivistInvestor 's on going project is here : Localization )

 

And there is on going task that how to get the localized Add-In Entities type names.

I checked resource dlls in Civil/AEC resource folder before hand, but there is no resources seems Add-In Entitiy types specific like vanilla ones.

 

Does anyone know more about this?

 

Thank you for your cooperation.

Labels (2)
1 REPLY 1
Message 2 of 2

I was checking loaded assemblies in civil 3d.

 

 

// data table definition
var table = new DataTable();
table.Columns.AddRange("AssemblyName,AssemblyFullName,AssemblyLocation,ResourceCount,Exception,Message".
    Split(",").Select(name => new DataColumn(name)).ToArray());

// prompt to the datatable
void PromptAsmResources(Assembly asm)
{
    var count = "";
    var except = "";
    var message = "";
    var location = "";
    try
    {
        count = asm.GetManifestResourceNames().Count().ToString();
        location = asm.Location;
    }
    catch (Exception ex)
    {
        except = ex.GetType().FullName;
        message = ex.Message;
    }
    //logger.Prompt(String.Join(",", new object[] { asm.FullName, count, except }));
    table.Rows.Add(new object[] { asm.GetName().Name, asm.FullName, location, count, except, message });
}

// check assemblies in the default domain.
var domain = System.AppDomain.CurrentDomain;
foreach (Assembly asm in domain.GetAssemblies())
    PromptAsmResources(asm);

// output to the csv (with Chincho ETL Lib)
using (var p = new ChoCSVWriter(@"C:\Temp\AssmeblyList.csv"))
{
    // write a header
    p.WriteFields(table.Columns
        .CastEnumerable<DataColumn>()
        .Select(column => $"\"{column.ColumnName}\"")
        .ToArray());

    // write data rows
    foreach (DataRow row in table.Rows)
        p.WriteFields(
            table.Columns
                .CastEnumerable<DataColumn>()
                .Select(column => $"\"{row[column]}\"")
                .ToArray());
}

 

 

 and here are the results (AssmeblyList.csv). Then I check assemblies with path has "ja-JP"(culture name) in excel.

moon_pelican_cat_0-1715236712659.png

Checking some specific assemblies in the list with ILSpy, but there was no resources lilke vanilla one.
Although some resources has localized label to use in the prompt which is showing on AutoCAD Civil3D or Map command.
I might think there are only such resoruces.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report