Community
Hello there,
How do i set the Justification property of a MTEXT.
Here i create the MTEXT:
public void CreateMText() { // Get the current document and database Document acDoc = acadApp.DocumentManager.MdiActiveDocument; Database acCurDb = acDoc.Database; // Start a transaction using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction()) { // Open the Block table for read BlockTable acBlkTbl; acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead) as BlockTable; // Open the Block table record Model space for write BlockTableRecord acBlkTblRec; acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord; // Create a multiline text object MText acMText = new MText(); acMText.SetDatabaseDefaults(); acMText.Location = new Point3d(2, 2, 0); acMText.TextStyleId = CreateTextStyle(); acMText.LayerId = Layer.CreateLayer("Mijn Tekst laag!!!"); //acMText.Width = 4; acMText.Contents = "This is a text string for the MText object. \nWith annotationscale added!!!"; acBlkTblRec.AppendEntity(acMText); acTrans.AddNewlyCreatedDBObject(acMText, true); SetScale("1:1", acMText); SetScale("1:50", acMText); SetScale("1:100", acMText); acadApp.ShowAlertDialog(acMText.Handle.Value.ToString()); // Save the changes and dispose of the transaction acTrans.Commit(); } }
I hope someone can help me.
Kind regards,
Irvin
Solved! Go to Solution.
Solved by jamierobertson1. Go to Solution.