새로운 TEXT/MTEXT 항목 추가
Contents
[
Hide
]새로운 TEXT/MTEXT 항목 추가하는 방법
문제: 새로운 TEXT/MTEXT 항목을 추가하는 방법입니다.
팁: 이를 위해 BlockEntities["*Model_Space"] 속성과 AddEntity를 사용하여 새 엔터티를 도면에 추가할 수 있으며, 크기를 업데이트하기 위해 UpdateSize 메서드를 잊지 마세요.
예제:
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); | |
CadText text = new CadText(); | |
text.DefaultValue = "Watermark text"; | |
text.TextHeight = 40; | |
text.FirstAlignment = new Cad3DPoint(300, 40); | |
text.LayerName = "0"; | |
cadImage.BlockEntities["*Model_Space"].AddEntity(text); | |
CadMText watermark = new CadMText(); | |
watermark.Text = "Watermark message"; | |
watermark.InitialTextHeight = 40; | |
watermark.InsertionPoint = new Cad3DPoint(300, 40); | |
watermark.LayerName = "0"; | |
cadImage.BlockEntities["*Model_Space"].AddEntity(watermark); | |
cadImage.UpdateSize(); |