DXF/DWG를 위한 텍스트 크기 조정

DXF/DWG를 위한 텍스트 크기 조정 방법

문제: DXF/DWG를 위한 텍스트 크기를 조정하는 방법입니다.

팁: 이를 위해 엔티티의 TextHeight 매개변수를 사용할 수 있지만, 매개변수에 대한 접근은 서로 다른 객체에 따라 다를 수 있음을 유의하십시오.

예시:

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());