Aggiungere un nuovo elemento TEXT/MTEXT

Come aggiungere un nuovo elemento TEXT/MTEXT

Problema: Come aggiungere un nuovo elemento TEXT/MTEXT.

Suggerimenti: Per questo puoi utilizzare la proprietà BlockEntities["*Model_Space"] e AddEntity per aggiungere nuove entità al disegno e non dimenticare il metodo UpdateSize per aggiornare le dimensioni.

Esempio:

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