دریافت تمام موجودیتهای TEXT/MTEXT از DWG/DXF
Contents
[
Hide
]چگونه تمام موجودیتهای TEXT/MTEXT را از DWG/DXF دریافت کنیم
مسئله: چگونه تمام موجودیتهای TEXT/MTEXT را از DWG/DXF دریافت کنیم.
نکات: برای این کار، شما نیاز دارید تا موجودیتهای CadText(DefaultValue) و CadMText(FullClearText) را از نقشه دریافت کنید.
مثال:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using CadImage cadImage = (CadImage)Image.Load(fileName); | |
foreach (CadBaseEntity entity in cadImage.Entities) | |
{ | |
if (entity.GetType() == typeof(CadText)) | |
{ | |
CadText text = (CadText)entity; | |
System.Console.WriteLine(text.DefaultValue); | |
} | |
if (entity.GetType() == typeof(CadMText)) | |
{ | |
CadMText mtext = (CadMText)entity; | |
System.Console.WriteLine(mtext.FullClearText); | |
} | |
} |