.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get localized type names or all geometry types

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
ilya.s.solovyev
788 Views, 2 Replies

Get localized type names or all geometry types

Is it possible to get localized names for AutoCAD .NET geometry types?

For example, I want to get "Полилиния" (in Russian) for Autodesk.AutoCAD.DatabaseServices.Polyline class.

 

If there is no solution, where can I get a list of all geometry types to translate them into another language programmatically?

2 REPLIES 2
Message 2 of 3

1. Those are not geometrical types but entities types.

2. Next code may help you:

[CommandMethod("GetName")]
public static void GetObjName()
{
  Document doc = Application.DocumentManager.MdiActiveDocument;
  Editor ed = doc.Editor;
  PromptEntityResult pres = ed.GetEntity("\nSelect Entity: ");
  if (pres.Status == PromptStatus.OK)
  {
    ed.WriteMessage("\nName: {0}", 
      Autodesk.AutoCAD.Internal.PropertyInspector
      .ObjectPropertyManagerProperties.GetDisplayName(pres.ObjectId));
  }
}

This code can display name of entity identifying with its ObjectId.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 3 of 3
Hallex
in reply to: ilya.s.solovyev

In addition to code above, this will return correct entity type:

Autodesk.AutoCAD.ApplicationServices.Application.ShowAlertDialog(string.Format("Name:\n{0}",pres.ObjectId.ObjectClass.DxfName));

 So if you clicked light polyline, this code return LWPOLYLINE instead of POLYLINE

as per in Alexander's code

_____________________________________
C6309D9E0751D165D0934D0621DFF27919

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost