تنظیم اندازه متن برای DXF/DWG
Contents
[
Hide
]چگونه اندازه متن را برای DXF/DWG تنظیم کنیم
مسئله: چگونه اندازه متن را برای DXF/DWG تنظیم کنیم.
نکات: برای انجام این کار، میتوانید از پارامتر TextHeight در موجودیتها استفاده کنید، اما توجه داشته باشید که دسترسی به این پارامتر ممکن است برای اشیاء مختلف متفاوت باشد.
مثال:
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
var fileName = @"facade_example.dwg"; | |
using CadImage cadImage = (CadImage) Image.Load(fileName); | |
foreach (CadBaseEntity entity in cadImage.Entities) | |
{ | |
if (entity is CadMText text && text.Text.Contains("Etage")) | |
{ | |
text.InitialTextHeight = 120; | |
} | |
if (entity is CadText cadText) | |
{ | |
cadText.TextHeight = 120; | |
} | |
if (entity is CadMLeader leader) | |
{ | |
leader.ContextData.TextHeight = 120; | |
} | |
if (entity is CadTolerance tolerance) | |
{ | |
cadImage.DimensionStyles[tolerance.DimensionStyleName].Dimtxt = 120; | |
} | |
} | |
cadImage.Save("facade_example_inc_text.pdf", new PdfOptions()); |