개정판 8214047e
dev issue #000 : fix
Change-Id: I2b2f824ec245e5cd7b83555697b88c7f86f52ab2
DTI_PID/SPPIDConverter/AutoModeling.cs | ||
---|---|---|
5226 | 5226 |
_LMSymbol = dataSource.GetSymbol(symbol.SPPID.RepresentationId); |
5227 | 5227 |
if (_LMSymbol != null) |
5228 | 5228 |
{ |
5229 |
BaseModel.Attribute attribute = symbol.ATTRIBUTES.Find(x => x.ASSOCITEM == text.UID); |
|
5230 |
if (attribute != null && !string.IsNullOrEmpty(attribute.VALUE) && attribute.VALUE != "None") |
|
5229 |
foreach (BaseModel.Attribute attribute in symbol.ATTRIBUTES.FindAll(x => x.ASSOCITEM == text.UID)) |
|
5231 | 5230 |
{ |
5232 |
AttributeMapping mapping = document.AttributeMappings.Find(x => x.UID == attribute.UID && !string.IsNullOrEmpty(x.SPPIDSYMBOLNAME)); |
|
5233 |
|
|
5234 |
if (mapping != null) |
|
5231 |
if (attribute != null && !string.IsNullOrEmpty(attribute.VALUE) && attribute.VALUE != "None") |
|
5235 | 5232 |
{ |
5236 |
double x = 0; |
|
5237 |
double y = 0; |
|
5233 |
AttributeMapping mapping = document.AttributeMappings.Find(x => x.UID == attribute.UID && !string.IsNullOrEmpty(x.SPPIDSYMBOLNAME)); |
|
5238 | 5234 |
|
5239 |
CalcLabelLocation(ref x, ref y, text.SPPID.ORIGINAL_X, text.SPPID.ORIGINAL_Y, text.SPPIDLabelLocation, mapping.Location); |
|
5240 |
SPPIDUtil.ConvertGridPoint(ref x, ref y); |
|
5241 |
Array array = new double[] { 0, x, y }; |
|
5242 |
text.SPPID.SPPID_X = x; |
|
5243 |
text.SPPID.SPPID_Y = y; |
|
5244 |
LMLabelPersist _LMLabelPersist = _placement.PIDPlaceLabel(mapping.SPPIDSYMBOLNAME, ref array, Rotation: text.ANGLE, LabeledItem: _LMSymbol.AsLMRepresentation(), IsLeaderVisible: mapping.LeaderLine); |
|
5245 |
if (_LMLabelPersist != null) |
|
5235 |
if (mapping != null) |
|
5246 | 5236 |
{ |
5247 |
text.SPPID.RepresentationId = _LMLabelPersist.AsLMRepresentation().Id; |
|
5248 |
_LMLabelPersist.Commit(); |
|
5249 |
ReleaseCOMObjects(_LMLabelPersist); |
|
5237 |
double x = 0; |
|
5238 |
double y = 0; |
|
5239 |
|
|
5240 |
CalcLabelLocation(ref x, ref y, text.SPPID.ORIGINAL_X, text.SPPID.ORIGINAL_Y, text.SPPIDLabelLocation, mapping.Location); |
|
5241 |
SPPIDUtil.ConvertGridPoint(ref x, ref y); |
|
5242 |
Array array = new double[] { 0, x, y }; |
|
5243 |
text.SPPID.SPPID_X = x; |
|
5244 |
text.SPPID.SPPID_Y = y; |
|
5245 |
LMLabelPersist _LMLabelPersist = _placement.PIDPlaceLabel(mapping.SPPIDSYMBOLNAME, ref array, Rotation: text.ANGLE, LabeledItem: _LMSymbol.AsLMRepresentation(), IsLeaderVisible: mapping.LeaderLine); |
|
5246 |
if (_LMLabelPersist != null) |
|
5247 |
{ |
|
5248 |
text.SPPID.RepresentationId = _LMLabelPersist.AsLMRepresentation().Id; |
|
5249 |
_LMLabelPersist.Commit(); |
|
5250 |
ReleaseCOMObjects(_LMLabelPersist); |
|
5251 |
} |
|
5250 | 5252 |
} |
5251 | 5253 |
} |
5252 | 5254 |
} |
... | ... | |
5260 | 5262 |
|
5261 | 5263 |
if (connectedLMConnector != null) |
5262 | 5264 |
{ |
5263 |
BaseModel.Attribute attribute = line.ATTRIBUTES.Find(x => x.ASSOCITEM == text.UID); |
|
5264 |
if (attribute != null && !string.IsNullOrEmpty(attribute.VALUE) && attribute.VALUE != "None") |
|
5265 |
foreach (BaseModel.Attribute attribute in line.ATTRIBUTES.FindAll(x => x.ASSOCITEM == text.UID)) |
|
5265 | 5266 |
{ |
5266 |
AttributeMapping mapping = document.AttributeMappings.Find(x => x.UID == attribute.UID && !string.IsNullOrEmpty(x.SPPIDSYMBOLNAME)); |
|
5267 |
|
|
5268 |
if (mapping != null) |
|
5267 |
if (attribute != null && !string.IsNullOrEmpty(attribute.VALUE) && attribute.VALUE != "None") |
|
5269 | 5268 |
{ |
5270 |
double x = 0; |
|
5271 |
double y = 0; |
|
5272 |
CalcLabelLocation(ref x, ref y, text.SPPID.ORIGINAL_X, text.SPPID.ORIGINAL_Y, text.SPPIDLabelLocation, mapping.Location); |
|
5273 |
SPPIDUtil.ConvertGridPoint(ref x, ref y); |
|
5274 |
Array array = new double[] { 0, x, y }; |
|
5269 |
AttributeMapping mapping = document.AttributeMappings.Find(x => x.UID == attribute.UID && !string.IsNullOrEmpty(x.SPPIDSYMBOLNAME)); |
|
5275 | 5270 |
|
5276 |
LMLabelPersist _LMLabelPersist = _placement.PIDPlaceLabel(mapping.SPPIDSYMBOLNAME, ref array, Rotation: text.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: mapping.LeaderLine); |
|
5277 |
if (_LMLabelPersist != null) |
|
5271 |
if (mapping != null) |
|
5278 | 5272 |
{ |
5279 |
text.SPPID.RepresentationId = _LMLabelPersist.AsLMRepresentation().Id; |
|
5280 |
_LMLabelPersist.Commit(); |
|
5281 |
|
|
5282 |
DependencyObject dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_LMLabelPersist.get_GraphicOID().ToString()] as DependencyObject; |
|
5283 |
if (dependency != null) |
|
5273 |
double x = 0; |
|
5274 |
double y = 0; |
|
5275 |
CalcLabelLocation(ref x, ref y, text.SPPID.ORIGINAL_X, text.SPPID.ORIGINAL_Y, text.SPPIDLabelLocation, mapping.Location); |
|
5276 |
SPPIDUtil.ConvertGridPoint(ref x, ref y); |
|
5277 |
Array array = new double[] { 0, x, y }; |
|
5278 |
|
|
5279 |
LMLabelPersist _LMLabelPersist = _placement.PIDPlaceLabel(mapping.SPPIDSYMBOLNAME, ref array, Rotation: text.ANGLE, LabeledItem: connectedLMConnector.AsLMRepresentation(), IsLeaderVisible: mapping.LeaderLine); |
|
5280 |
if (_LMLabelPersist != null) |
|
5284 | 5281 |
{ |
5285 |
radApp.ActiveSelectSet.RemoveAll(); |
|
5286 |
radApp.ActiveSelectSet.Add(dependency); |
|
5287 |
Ingr.RAD2D.Transform transform = dependency.GetTransform(); |
|
5288 |
transform.DefineByMove2d(x - _LMLabelPersist.get_XCoordinate(), y - _LMLabelPersist.get_YCoordinate()); |
|
5289 |
radApp.ActiveSelectSet.Transform(transform, true); |
|
5290 |
radApp.ActiveSelectSet.RemoveAll(); |
|
5291 |
} |
|
5282 |
text.SPPID.RepresentationId = _LMLabelPersist.AsLMRepresentation().Id; |
|
5283 |
_LMLabelPersist.Commit(); |
|
5292 | 5284 |
|
5293 |
ReleaseCOMObjects(_LMLabelPersist); |
|
5285 |
DependencyObject dependency = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_LMLabelPersist.get_GraphicOID().ToString()] as DependencyObject; |
|
5286 |
if (dependency != null) |
|
5287 |
{ |
|
5288 |
radApp.ActiveSelectSet.RemoveAll(); |
|
5289 |
radApp.ActiveSelectSet.Add(dependency); |
|
5290 |
Ingr.RAD2D.Transform transform = dependency.GetTransform(); |
|
5291 |
transform.DefineByMove2d(x - _LMLabelPersist.get_XCoordinate(), y - _LMLabelPersist.get_YCoordinate()); |
|
5292 |
radApp.ActiveSelectSet.Transform(transform, true); |
|
5293 |
radApp.ActiveSelectSet.RemoveAll(); |
|
5294 |
} |
|
5295 |
|
|
5296 |
ReleaseCOMObjects(_LMLabelPersist); |
|
5297 |
} |
|
5294 | 5298 |
} |
5295 | 5299 |
} |
5296 | 5300 |
} |
DTI_PID/SPPIDConverter/BaseModel/Document.cs | ||
---|---|---|
325 | 325 |
AREA = item.Element("AREA").Value, |
326 | 326 |
SCENE = item.Element("SCENE").Value |
327 | 327 |
}; |
328 |
|
|
329 | 328 |
TEXTINFOS.Add(text); |
330 | 329 |
} |
331 | 330 |
} |
내보내기 Unified diff