개정판 87f02fc0
dev issue #000 : Zero Length Line Join 기능 추가
Change-Id: I134910ab74219b690200ceefd6d9124163538471
DTI_PID/SPPIDConverter/ConverterDocking.cs | ||
---|---|---|
163 | 163 |
Placement _placement = new Placement(); |
164 | 164 |
LMADataSource dataSource = new LMADataSource();//placement.PIDDataSource; |
165 | 165 |
|
166 |
string modelItemId = "B79C53F295454F489B9DBCD9F1078D3E"; |
|
167 |
LMOPC opc = dataSource.GetOPC(modelItemId); |
|
168 |
try |
|
166 |
foreach (var item in radApp.ActiveDocument.ActiveSheet.DrawingObjects) |
|
169 | 167 |
{ |
170 |
if (opc != null) |
|
168 |
Ingr.RAD2D.DependencyObject dependencyObject = item as Ingr.RAD2D.DependencyObject; |
|
169 |
if (dependencyObject != null) |
|
171 | 170 |
{ |
172 |
LMOPC pairedOPC = opc.pairedWithOPCObject; |
|
173 |
//MessageBox.Show(pairedOPC.get_ItemStatus()); |
|
174 |
//pairedOPC.Attributes[] |
|
175 |
_placement.PIDPlaceSymbol(@"\Piping\Piping OPC's\Off-Drawing.sym", 0, 0, 0, 0, pairedOPC.AsLMAItem()); |
|
171 |
string sModelItemType = string.Empty; |
|
172 |
string sModelID = string.Empty; |
|
173 |
foreach (Ingr.RAD2D.AttributeSet attributes in dependencyObject.AttributeSets) |
|
174 |
{ |
|
175 |
foreach (var attribute in attributes) |
|
176 |
{ |
|
177 |
if (attribute.Name == "ModelItemType") |
|
178 |
sModelItemType = attribute.GetValue().ToString(); |
|
179 |
else if (attribute.Name == "ModelID") |
|
180 |
sModelID = attribute.GetValue().ToString(); |
|
181 |
} |
|
182 |
} |
|
183 |
|
|
184 |
if (sModelItemType == "PipeRun" && !string.IsNullOrEmpty(sModelID)) |
|
185 |
{ |
|
186 |
LMModelItem modelItem = dataSource.GetModelItem(sModelID); |
|
187 |
if (modelItem != null && modelItem.get_ItemStatus() == "Active") |
|
188 |
{ |
|
189 |
foreach (LMRepresentation rep in modelItem.Representations) |
|
190 |
{ |
|
191 |
if (rep.Attributes["RepresentationType"].get_Value() == "Connector" && rep.Attributes["ItemStatus"].get_Value() == "Active") |
|
192 |
{ |
|
193 |
LMConnector connector = dataSource.GetConnector(rep.Id); |
|
194 |
if (connector.get_IsZeroLength() && connector.LabelPersists.Count == 0) |
|
195 |
{ |
|
196 |
|
|
197 |
} |
|
198 |
} |
|
199 |
} |
|
200 |
|
|
201 |
} |
|
202 |
} |
|
176 | 203 |
} |
177 | 204 |
} |
178 |
catch (Exception ex) |
|
179 |
{ |
|
180 |
System.Windows.Forms.MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); |
|
181 |
} |
|
182 |
finally |
|
183 |
{ |
|
184 | 205 |
|
185 |
} |
|
206 |
//string modelItemId = "B79C53F295454F489B9DBCD9F1078D3E"; |
|
207 |
//LMOPC opc = dataSource.GetOPC(modelItemId); |
|
208 |
//try |
|
209 |
//{ |
|
210 |
// if (opc != null) |
|
211 |
// { |
|
212 |
// LMOPC pairedOPC = opc.pairedWithOPCObject; |
|
213 |
// //MessageBox.Show(pairedOPC.get_ItemStatus()); |
|
214 |
// //pairedOPC.Attributes[] |
|
215 |
// _placement.PIDPlaceSymbol(@"\Piping\Piping OPC's\Off-Drawing.sym", 0, 0, 0, 0, pairedOPC.AsLMAItem()); |
|
216 |
// } |
|
217 |
//} |
|
218 |
//catch (Exception ex) |
|
219 |
//{ |
|
220 |
// System.Windows.Forms.MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); |
|
221 |
//} |
|
222 |
//finally |
|
223 |
//{ |
|
186 | 224 |
|
187 |
if (radApp.ActiveSelectSet.Count > 0) |
|
188 |
{ |
|
189 |
DependencyObject line2D = radApp.ActiveSelectSet[0] as DependencyObject; |
|
190 |
if (line2D != null) |
|
191 |
{ |
|
192 |
double minX = 0; |
|
193 |
double minY = 0; |
|
194 |
double maxX = 0; |
|
195 |
double maxY = 0; |
|
196 |
line2D.Range(out minX, out minY, out maxX, out maxY); |
|
225 |
//} |
|
197 | 226 |
|
198 |
StringBuilder sb = new StringBuilder(); |
|
199 |
sb.AppendLine(minX.ToString()); |
|
200 |
sb.AppendLine(minY.ToString()); |
|
201 |
sb.AppendLine(maxX.ToString()); |
|
202 |
sb.AppendLine(maxY.ToString()); |
|
203 |
MessageBox.Show(sb.ToString()); |
|
227 |
//if (radApp.ActiveSelectSet.Count > 0) |
|
228 |
//{ |
|
229 |
// DependencyObject line2D = radApp.ActiveSelectSet[0] as DependencyObject; |
|
230 |
// if (line2D != null) |
|
231 |
// { |
|
232 |
// double minX = 0; |
|
233 |
// double minY = 0; |
|
234 |
// double maxX = 0; |
|
235 |
// double maxY = 0; |
|
236 |
// line2D.Range(out minX, out minY, out maxX, out maxY); |
|
237 |
|
|
238 |
// StringBuilder sb = new StringBuilder(); |
|
239 |
// sb.AppendLine(minX.ToString()); |
|
240 |
// sb.AppendLine(minY.ToString()); |
|
241 |
// sb.AppendLine(maxX.ToString()); |
|
242 |
// sb.AppendLine(maxY.ToString()); |
|
243 |
// MessageBox.Show(sb.ToString()); |
|
244 |
|
|
245 |
// } |
|
246 |
// else |
|
247 |
// MessageBox.Show(Msg.SelectLine, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
248 |
//} |
|
249 |
//else |
|
250 |
// MessageBox.Show(Msg.SelectLine, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
204 | 251 |
|
205 |
} |
|
206 |
else |
|
207 |
MessageBox.Show(Msg.SelectLine, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
208 |
} |
|
209 |
else |
|
210 |
MessageBox.Show(Msg.SelectLine, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
211 |
|
|
212 | 252 |
} |
213 | 253 |
|
214 | 254 |
|
내보내기 Unified diff