개정판 1a3a74a8
dev issue #000 : 라벨들 위치 설정가능하게 / 모델링 수정
Change-Id: I69a1eaa92469426c6e329dde3c7f652660f19f56
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
1276 | 1276 |
|
1277 | 1277 |
if (mapping != null) |
1278 | 1278 |
{ |
1279 |
Array array = new double[] { 0, text.SPPID.ORIGINAL_X, text.SPPID.ORIGINAL_Y }; |
|
1279 |
Array array = null; |
|
1280 |
double x = 0; |
|
1281 |
double y = 0; |
|
1282 |
if (mapping.Location == Location.None) |
|
1283 |
{ |
|
1284 |
x = text.SPPID.ORIGINAL_X; |
|
1285 |
y = text.SPPID.ORIGINAL_Y; |
|
1286 |
} |
|
1287 |
|
|
1288 |
if (mapping.Location.HasFlag(Location.Center)) |
|
1289 |
{ |
|
1290 |
x = (text.SPPIDLabelLocation.X1 + text.SPPIDLabelLocation.X2) / 2; |
|
1291 |
y = (text.SPPIDLabelLocation.Y1 + text.SPPIDLabelLocation.Y2) / 2; |
|
1292 |
} |
|
1293 |
|
|
1294 |
if (mapping.Location.HasFlag(Location.Left)) |
|
1295 |
x = text.SPPIDLabelLocation.X1; |
|
1296 |
else if (mapping.Location.HasFlag(Location.Right)) |
|
1297 |
x = text.SPPIDLabelLocation.X2; |
|
1298 |
|
|
1299 |
if (mapping.Location.HasFlag(Location.Down)) |
|
1300 |
y = text.SPPIDLabelLocation.Y1; |
|
1301 |
else if (mapping.Location.HasFlag(Location.Up)) |
|
1302 |
y = text.SPPIDLabelLocation.Y2; |
|
1303 |
|
|
1304 |
array = new double[] { 0, x, y }; |
|
1305 |
|
|
1280 | 1306 |
LMLabelPersist _LMLabelPersist = _placement.PIDPlaceLabel(mapping.SPPIDSYMBOLNAME, ref array, Rotation: text.ANGLE, LabeledItem: _LMSymbol.AsLMRepresentation(), IsLeaderVisible: true); |
1281 | 1307 |
if (_LMLabelPersist!=null) |
1282 | 1308 |
{ |
1283 |
DependencyObject tt = radApp.ActiveDocument.ActiveSheet.DrawingObjects[((dynamic)_LMLabelPersist).GraphicOID]; |
|
1284 |
double x1 = 0; |
|
1285 |
double x2 = 0; |
|
1286 |
double y1 = 0; |
|
1287 |
double y2 = 0; |
|
1288 |
tt.Range(out x1, out y1, out x2, out y2); |
|
1289 |
|
|
1290 |
_LMLabelPersist.Commit(); |
|
1291 |
_placement.PIDRemovePlacement(_LMLabelPersist.AsLMRepresentation()); |
|
1292 |
ReleaseCOMObjects(_LMLabelPersist); |
|
1293 |
double newX = Math.Abs(x1 - x2) / 2; |
|
1294 |
double newY = Math.Abs(y1 - y2) / 2; |
|
1295 |
array = new double[] { 0, text.SPPID.ORIGINAL_X + newX, text.SPPID.ORIGINAL_Y - newY }; |
|
1296 |
_LMLabelPersist = _placement.PIDPlaceLabel(mapping.SPPIDSYMBOLNAME, ref array, Rotation: text.ANGLE, LabeledItem: _LMSymbol.AsLMRepresentation(), IsLeaderVisible: true); |
|
1297 | 1309 |
_LMLabelPersist.Commit(); |
1298 | 1310 |
ReleaseCOMObjects(_LMLabelPersist); |
1299 | 1311 |
} |
내보내기 Unified diff