개정판 ecf30b64
dev issue #507 : remove drawing size
Change-Id: I056833efd242a005dcfd8a067918c8023291f0fe
DTI_PID/SPPIDConverter/ConverterDocking.cs | ||
---|---|---|
30 | 30 |
public partial class ConverterDocking : UserControl |
31 | 31 |
{ |
32 | 32 |
Ingr.RAD2D.Application application; |
33 |
static bool addEvent = false; |
|
33 |
internal static bool addEvent = false;
|
|
34 | 34 |
public ConverterDocking() |
35 | 35 |
{ |
36 | 36 |
InitializeComponent(); |
... | ... | |
43 | 43 |
dApplication = null; |
44 | 44 |
try |
45 | 45 |
{ |
46 |
textEditDrawingX.EditValue = Settings.Default.DrawingX; |
|
47 |
textEditDrawingY.EditValue = Settings.Default.DrawingY; |
|
48 |
|
|
49 | 46 |
Project_Info _ProjectInfo = Project_Info.GetInstance(); |
50 | 47 |
_ProjectInfo.DefaultPath = Settings.Default.ProjectPath; |
51 | 48 |
_ProjectInfo.DBType = (ID2DB_Type)Settings.Default.ProjectDBType; |
... | ... | |
213 | 210 |
} |
214 | 211 |
} |
215 | 212 |
|
216 |
private void btnGetDrawingSize_Click(object sender, EventArgs e) |
|
217 |
{ |
|
218 |
dynamic application = Interaction.GetObject("", "PIDAutomation.Application"); |
|
219 |
WrapperApplication wApp = new WrapperApplication(application.Application); |
|
220 |
Ingr.RAD2D.Application radApp = wApp.RADApplication; |
|
221 |
|
|
222 |
if (radApp.ActiveSelectSet.Count > 0) |
|
223 |
{ |
|
224 |
DependencyObject line2D = radApp.ActiveSelectSet[0] as DependencyObject; |
|
225 |
if (line2D != null) |
|
226 |
{ |
|
227 |
double minX = 0; |
|
228 |
double minY = 0; |
|
229 |
double maxX = 0; |
|
230 |
double maxY = 0; |
|
231 |
line2D.Range(out minX, out minY, out maxX, out maxY); |
|
232 |
|
|
233 |
Settings.Default.DrawingX = maxX - minX; |
|
234 |
Settings.Default.DrawingY = maxY - minY; |
|
235 |
Settings.Default.Save(); |
|
236 |
|
|
237 |
textEditDrawingX.EditValue = Settings.Default.DrawingX; |
|
238 |
textEditDrawingY.EditValue = Settings.Default.DrawingY; |
|
239 |
} |
|
240 |
else |
|
241 |
MessageBox.Show(Msg.SelectLine, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
242 |
} |
|
243 |
else |
|
244 |
MessageBox.Show(Msg.SelectLine, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
|
245 |
} |
|
246 |
|
|
247 | 213 |
#region SPPID Utils |
248 | 214 |
|
249 | 215 |
#region Symmetry |
... | ... | |
1483 | 1449 |
//string a = "0A509911F33441A2AF088BFBA78B770D"; |
1484 | 1450 |
//LMLabelPersist label = dataSource.GetLabelPersist(a); |
1485 | 1451 |
//label.set_XCoordinate(0.4); |
1486 |
|
|
1487 |
Symbol2d symbol = application.ActiveSelectSet[0] as Symbol2d; |
|
1488 |
double minX = double.MaxValue; |
|
1489 |
int index = 0; |
|
1490 |
bool start = false; |
|
1491 |
Line2d tar = null; |
|
1492 |
double rx1 = 0, ry1 = 0, rx2 = 0, ry2 = 0; |
|
1493 |
if (symbol != null) |
|
1452 |
|
|
1453 |
foreach (AttributeSet attributes in application.ActiveDocument.AttributeSets) |
|
1494 | 1454 |
{ |
1495 |
for (int i = 0; i < symbol.DrawingObjects.Count; i++)
|
|
1455 |
foreach (Ingr.RAD2D.Attribute attribute in attributes)
|
|
1496 | 1456 |
{ |
1497 |
DrawingObjectBase drawingObj = symbol.DrawingObjects[i]; |
|
1498 |
|
|
1499 |
if (drawingObj.GetType() == typeof(Line2d)) |
|
1500 |
{ |
|
1501 |
Line2d line = drawingObj as Line2d; |
|
1502 |
double x1, y1, x2, y2; |
|
1503 |
line.GetStartPoint(out x1, out y1); |
|
1504 |
line.GetEndPoint(out x2, out y2); |
|
1505 |
if (x1 < minX) |
|
1506 |
{ |
|
1507 |
minX = x1; |
|
1508 |
index = i; |
|
1509 |
start = true; |
|
1510 |
tar = line; |
|
1511 |
|
|
1512 |
rx1 = x1; |
|
1513 |
rx2 = x2; |
|
1514 |
ry1 = y1; |
|
1515 |
ry2 = y2; |
|
1516 |
} |
|
1517 |
|
|
1518 |
if (x2 < minX) |
|
1519 |
{ |
|
1520 |
minX = x2; |
|
1521 |
index = i; |
|
1522 |
start = false; |
|
1523 |
tar = line; |
|
1524 |
|
|
1525 |
rx1 = x1; |
|
1526 |
rx2 = x2; |
|
1527 |
ry1 = y1; |
|
1528 |
ry2 = y2; |
|
1529 |
} |
|
1530 |
} |
|
1457 |
string name = attribute.Name; |
|
1458 |
object value = attribute.GetValue(); |
|
1459 |
|
|
1531 | 1460 |
} |
1532 | 1461 |
} |
1533 |
|
|
1534 |
if (start) |
|
1535 |
{ |
|
1536 |
symbol.Symbol2dParameters[0].Value = 0.02; |
|
1537 |
//Ingr.RAD2D.Group group = symbol.Convert(); |
|
1538 |
//group. |
|
1539 |
} |
|
1540 |
else |
|
1541 |
{ |
|
1542 |
|
|
1543 |
} |
|
1544 | 1462 |
} |
1545 | 1463 |
|
1546 | 1464 |
private void AutoJoinPipeRun() |
내보내기 Unified diff