개정판 a03f7b94
dev issue #1229 : add text rotation
Change-Id: I46e8bd8ecfd00ef6caa2c17c8b4b092ebc68256d
DTI_PID/APIDConverter/AutoModeling.cs | ||
---|---|---|
246 | 246 |
return; |
247 | 247 |
|
248 | 248 |
if (text.Aveva.LabelType == LabelType.SingleText) |
249 |
DrawText(text.Aveva.X, text.Aveva.Y, text.Aveva.Height, text.VALUE); |
|
249 |
DrawText(text.Aveva.X, text.Aveva.Y, text.Aveva.Height, text.VALUE, text.Aveva.Angle);
|
|
250 | 250 |
else if (text.Aveva.LabelType == LabelType.MultiText) |
251 | 251 |
{ |
252 | 252 |
string[] valueArray = text.VALUE.Split(new string[] { "\n" }, StringSplitOptions.None); |
... | ... | |
265 | 265 |
else if (text.TextAngle == TextAngle.Degree90 || text.TextAngle == TextAngle.Degree270) |
266 | 266 |
x = x + text.Aveva.Height * i; |
267 | 267 |
|
268 |
DrawText(x, y, text.Aveva.Height, values[i]); |
|
268 |
DrawText(x, y, text.Aveva.Height, values[i], text.Aveva.Angle);
|
|
269 | 269 |
} |
270 | 270 |
} |
271 | 271 |
|
... | ... | |
277 | 277 |
return; |
278 | 278 |
|
279 | 279 |
if (note.Aveva.LabelType == LabelType.SingleNote) |
280 |
DrawText(note.Aveva.X, note.Aveva.Y, note.Aveva.Height, note.VALUE); |
|
280 |
DrawText(note.Aveva.X, note.Aveva.Y, note.Aveva.Height, note.VALUE, note.Aveva.Angle);
|
|
281 | 281 |
else if (note.Aveva.LabelType == LabelType.MultiNote) |
282 | 282 |
{ |
283 | 283 |
string[] valueArray = note.VALUE.Split(new string[] { "\n" }, StringSplitOptions.None); |
... | ... | |
296 | 296 |
else if (note.TextAngle == TextAngle.Degree90 || note.TextAngle == TextAngle.Degree270) |
297 | 297 |
x = x + note.Aveva.Height * i; |
298 | 298 |
|
299 |
DrawText(x, y, note.Aveva.Height, values[i]); |
|
299 |
DrawText(x, y, note.Aveva.Height, values[i], note.Aveva.Angle);
|
|
300 | 300 |
} |
301 | 301 |
} |
302 | 302 |
} |
... | ... | |
468 | 468 |
|
469 | 469 |
return handle; |
470 | 470 |
} |
471 |
private void DrawText(double x, double y, double height, string text) |
|
471 |
private void DrawText(double x, double y, double height, string text, double rotation)
|
|
472 | 472 |
{ |
473 | 473 |
// Get the current document and database |
474 | 474 |
Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; |
... | ... | |
493 | 493 |
acText.Position = new Point3d(x, y, 0); |
494 | 494 |
acText.Height = height; |
495 | 495 |
acText.TextString = text; |
496 |
acText.Rotation = rotation; |
|
496 | 497 |
|
497 | 498 |
acBlkTblRec.AppendEntity(acText); |
498 | 499 |
acTrans.AddNewlyCreatedDBObject(acText, true); |
내보내기 Unified diff