개정판 2e409996
dev issue #1229 : remove multiline method
Change-Id: I6fda290848116c7c009b440cfd38fd6037b63075
DTI_PID/APIDConverter/AutoModeling.cs | ||
---|---|---|
502 | 502 |
acTrans.Commit(); |
503 | 503 |
} |
504 | 504 |
} |
505 |
private void DrawMultiLineText(double x, double y, double width, string text) |
|
506 |
{ |
|
507 |
// Get the current document and database |
|
508 |
Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; |
|
509 |
Database acCurDb = acDoc.Database; |
|
510 |
|
|
511 |
// Start a transaction |
|
512 |
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction()) |
|
513 |
{ |
|
514 |
// Open the Block table for read |
|
515 |
BlockTable acBlkTbl; |
|
516 |
acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, |
|
517 |
OpenMode.ForRead) as BlockTable; |
|
518 |
|
|
519 |
// Open the Block table record Model space for write |
|
520 |
BlockTableRecord acBlkTblRec; |
|
521 |
acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace], |
|
522 |
OpenMode.ForWrite) as BlockTableRecord; |
|
523 |
|
|
524 |
// Create a multiline text object |
|
525 |
using (MText acMText = new MText()) |
|
526 |
{ |
|
527 |
acMText.Location = new Point3d(x, y, 0); |
|
528 |
acMText.Width = width; |
|
529 |
acMText.Contents = text; |
|
530 |
|
|
531 |
acBlkTblRec.AppendEntity(acMText); |
|
532 |
acTrans.AddNewlyCreatedDBObject(acMText, true); |
|
533 |
} |
|
534 |
|
|
535 |
// Save the changes and dispose of the transaction |
|
536 |
acTrans.Commit(); |
|
537 |
} |
|
538 |
} |
|
539 | 505 |
#endregion |
540 | 506 |
|
541 | 507 |
#region Autocad Utils |
내보내기 Unified diff