hytos / DTI_PID / APIDConverter / AutoModeling.cs @ 128c844f
이력 | 보기 | 이력해설 | 다운로드 (21.2 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Collections; |
4 |
using System.Configuration; |
5 |
using System.Data; |
6 |
using System.Data.Common; |
7 |
using System.Data.SqlClient; |
8 |
using System.IO; |
9 |
|
10 |
using Autodesk.AutoCAD.ApplicationServices; |
11 |
using Autodesk.AutoCAD.ApplicationServices.Core; |
12 |
using Autodesk.AutoCAD.DatabaseServices; |
13 |
using Autodesk.AutoCAD.EditorInput; |
14 |
using Autodesk.AutoCAD.Geometry; |
15 |
using Autodesk.AutoCAD.Interop; |
16 |
using Autodesk.AutoCAD.Interop.Common; |
17 |
using Autodesk.AutoCAD.Runtime; |
18 |
using Autodesk.AutoCAD.Windows; |
19 |
|
20 |
using AVEVA.PID.Components; |
21 |
using AVEVA.PID.GUI; |
22 |
using AVEVA.PID.Common; |
23 |
using AVEVA.PID.DWGSelector; |
24 |
|
25 |
using AVEVA.PID.CustomizationUtility.DB; |
26 |
using AVEVA.PID.CustomizationUtility.Model; |
27 |
using AVEVA.PID.CustomizationUtility.Properties; |
28 |
|
29 |
namespace AVEVA.PID.CustomizationUtility |
30 |
{ |
31 |
public class AutoModeling |
32 |
{ |
33 |
public static AutoModeling Running { get; set; } |
34 |
Model.Document document; |
35 |
|
36 |
public AutoModeling(Model.Document document) |
37 |
{ |
38 |
this.document = document; |
39 |
} |
40 |
|
41 |
public void CreateDrawing() |
42 |
{ |
43 |
string outPath = Project_DB.GetDirectiveValue("DRGPTH"); |
44 |
string tempPath = Path.GetTempPath(); |
45 |
string selectedFullPath = Path.Combine(tempPath, document.AvevaTemplateName + ".DWT"); |
46 |
|
47 |
DWTSelector.strDrawingNumber = document.AvevaDrawingNumber; |
48 |
DWTSelector.strSheetNumber = document.AvevaSheetNumber; |
49 |
DWTSelector.strCadFileName = document.AvevaDrawingNumber + document.AvevaSheetNumber; |
50 |
DWTSelector.strCadFilePath = outPath; |
51 |
|
52 |
try |
53 |
{ |
54 |
string text = ReadWriteDrawingData.ReadTemplateData(document.AvevaTemplateName, document.AvevaTemplateID, selectedFullPath, false); |
55 |
Autodesk.AutoCAD.Interop.AcadApplication acadApplication = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication as Autodesk.AutoCAD.Interop.AcadApplication; |
56 |
Autodesk.AutoCAD.Interop.AcadDocument acadDocument = acadApplication.Documents.Add(text); |
57 |
|
58 |
Commands.addLatestPidvesrionToDictionary(); |
59 |
AVVPropCmd.ActivateAcad(); |
60 |
|
61 |
if (acadDocument != null) |
62 |
{ |
63 |
Running = this; |
64 |
acadApplication.ActiveDocument = acadDocument; |
65 |
acadDocument.SendCommand("QSAVE "); |
66 |
acadDocument.SendCommand("APPIDRun "); |
67 |
acadDocument.SendCommand("QSAVE "); |
68 |
Running = null; |
69 |
} |
70 |
} |
71 |
catch (System.Exception ex) |
72 |
{ |
73 |
|
74 |
} |
75 |
|
76 |
GC.Collect(); |
77 |
} |
78 |
public void Run() |
79 |
{ |
80 |
try |
81 |
{ |
82 |
RunLineModeling(); |
83 |
RunSymbolModeling(); |
84 |
} |
85 |
catch (System.Exception ex) |
86 |
{ |
87 |
System.Windows.Forms.MessageBox.Show(ex.Message + @"\n" + ex.StackTrace); |
88 |
} |
89 |
} |
90 |
|
91 |
#region Run Method |
92 |
private void RunLineModeling() |
93 |
{ |
94 |
foreach (var item in document.LINES) |
95 |
{ |
96 |
if (item.Aveva.Handle == 0) |
97 |
LineModeling(item); |
98 |
} |
99 |
} |
100 |
private void RunSymbolModeling() |
101 |
{ |
102 |
foreach (var item in document.SYMBOLS) |
103 |
{ |
104 |
if (item.Aveva.Handle == 0) |
105 |
SymbolModeling(item); |
106 |
} |
107 |
} |
108 |
#endregion |
109 |
|
110 |
#region Modeling Method |
111 |
private void LineModeling(Model.Line line) |
112 |
{ |
113 |
List<Model.Line> groupLine = new List<Model.Line>(); |
114 |
List<string> points = new List<string>(); |
115 |
GetConnectedGroupLine(line, groupLine, false); |
116 |
GetGroupLinePoints(groupLine, points); |
117 |
|
118 |
long handle = 0; |
119 |
if (line.Aveva.Type == Model.Type.Pipe) |
120 |
handle = DrawPipe(line.Aveva.Name, points); |
121 |
else if (line.Aveva.Type == Model.Type.Signal) |
122 |
handle = DrawSignal(line.Aveva.Name, points); |
123 |
|
124 |
foreach (var item in groupLine) |
125 |
item.Aveva.Handle = handle; |
126 |
} |
127 |
private void SymbolModeling(Symbol symbol) |
128 |
{ |
129 |
long handle = InsertSymbol(symbol.Aveva.Name, symbol.Aveva.X, symbol.Aveva.Y); |
130 |
if (handle != 0) |
131 |
{ |
132 |
symbol.Aveva.Handle = handle; |
133 |
ObjectId objectId = GetObjectIdByHandle(handle); |
134 |
if (objectId != ObjectId.Null) |
135 |
{ |
136 |
SetBlockReferenceRotation(objectId, symbol.ANGLE); |
137 |
} |
138 |
} |
139 |
|
140 |
} |
141 |
#endregion |
142 |
|
143 |
#region Drawing Method |
144 |
private long DrawPipe(string style, List<string> coordinates) |
145 |
{ |
146 |
List<long> prevHandles = GetAllGroupHandles(); |
147 |
|
148 |
GUIUtils.SetPipeStyle(style); |
149 |
Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; |
150 |
Editor editor = acDoc.Editor; |
151 |
List<object> commandParam = new List<object>(); |
152 |
//command name |
153 |
commandParam.Add("DRPIPE"); |
154 |
//coordinate |
155 |
foreach (var item in coordinates) |
156 |
commandParam.Add(item); |
157 |
//enter |
158 |
commandParam.Add(null); |
159 |
//enter |
160 |
commandParam.Add(null); |
161 |
|
162 |
editor.Command(commandParam.ToArray()); |
163 |
|
164 |
List<long> newHandles = GetAllGroupHandles(); |
165 |
List<long> otherHandles = new List<long>(); |
166 |
foreach (var item in newHandles) |
167 |
if (!prevHandles.Contains(item)) |
168 |
otherHandles.Add(item); |
169 |
|
170 |
if (otherHandles.Count == 1) |
171 |
return otherHandles[0]; |
172 |
else |
173 |
return 0; |
174 |
} |
175 |
private long DrawPipe(string style, List<string> coordinates, ObjectId objectId) |
176 |
{ |
177 |
List<long> prevHandles = GetAllGroupHandles(); |
178 |
GUIUtils.SetPipeStyle(style); |
179 |
|
180 |
Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; |
181 |
Editor editor = acDoc.Editor; |
182 |
List<object> commandParam = new List<object>(); |
183 |
//command name |
184 |
commandParam.Add("DRPIPE"); |
185 |
//coordinate |
186 |
foreach (var item in coordinates) |
187 |
commandParam.Add(item); |
188 |
//enter |
189 |
commandParam.Add(null); |
190 |
|
191 |
//Input Object ID |
192 |
commandParam.Add(objectId); |
193 |
|
194 |
//enter |
195 |
commandParam.Add(null); |
196 |
|
197 |
editor.Command(commandParam.ToArray()); |
198 |
|
199 |
List<long> newHandles = GetAllGroupHandles(); |
200 |
List<long> otherHandles = new List<long>(); |
201 |
foreach (var item in newHandles) |
202 |
if (!prevHandles.Contains(item)) |
203 |
otherHandles.Add(item); |
204 |
|
205 |
if (otherHandles.Count == 1) |
206 |
return otherHandles[0]; |
207 |
else |
208 |
return 0; |
209 |
} |
210 |
private long DrawSignal(string style, List<string> coordinates) |
211 |
{ |
212 |
List<long> prevHandles = GetAllGroupHandles(); |
213 |
|
214 |
GUIUtils.SetPipeStyle(style); |
215 |
Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; |
216 |
Editor editor = acDoc.Editor; |
217 |
List<object> commandParam = new List<object>(); |
218 |
//command name |
219 |
commandParam.Add("VPESIGNAL"); |
220 |
//coordinate |
221 |
foreach (var item in coordinates) |
222 |
commandParam.Add(item); |
223 |
//enter |
224 |
commandParam.Add(null); |
225 |
|
226 |
editor.Command(commandParam.ToArray()); |
227 |
|
228 |
List<long> newHandles = GetAllGroupHandles(); |
229 |
List<long> otherHandles = new List<long>(); |
230 |
foreach (var item in newHandles) |
231 |
if (!prevHandles.Contains(item)) |
232 |
otherHandles.Add(item); |
233 |
|
234 |
if (otherHandles.Count == 1) |
235 |
return otherHandles[0]; |
236 |
else |
237 |
return 0; |
238 |
} |
239 |
private long InsertSymbol(string insertSymbolName, double x, double y) |
240 |
{ |
241 |
long handle = 0; |
242 |
try |
243 |
{ |
244 |
List<long> prevHandles = GetAllBlockHandlesByName(insertSymbolName); |
245 |
|
246 |
AVEVA.PID.Utilities.DrawingData drawingData = new AVEVA.PID.Utilities.DrawingData(); |
247 |
drawingData.InsertSymbolName = insertSymbolName; |
248 |
Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; |
249 |
Editor editor = acDoc.Editor; |
250 |
List<object> commandParam = new List<object>(); |
251 |
commandParam.Add("INSSYM"); |
252 |
Point3d point = new Point3d(x, y, 0); |
253 |
commandParam.Add(point); |
254 |
commandParam.Add(null); |
255 |
|
256 |
editor.Command(commandParam.ToArray()); |
257 |
|
258 |
List<long> newHandles = GetAllBlockHandlesByName(insertSymbolName); |
259 |
List<long> otherHandles = new List<long>(); |
260 |
foreach (var item in newHandles) |
261 |
if (!prevHandles.Contains(item)) |
262 |
otherHandles.Add(item); |
263 |
|
264 |
if (otherHandles.Count == 1) |
265 |
return otherHandles[0]; |
266 |
else |
267 |
return 0; |
268 |
} |
269 |
catch (System.Exception ex) |
270 |
{ |
271 |
|
272 |
} |
273 |
|
274 |
return handle; |
275 |
} |
276 |
#endregion |
277 |
|
278 |
#region Autocad Utils |
279 |
private List<long> GetAllBlockHandlesByName(string name) |
280 |
{ |
281 |
List<long> handles = new List<long>(); |
282 |
|
283 |
Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; |
284 |
Database acCurDb = acDoc.Database; |
285 |
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction()) |
286 |
{ |
287 |
BlockTable gd = (BlockTable)acTrans.GetObject(acCurDb.BlockTableId, OpenMode.ForRead); |
288 |
foreach (var entry in gd) |
289 |
{ |
290 |
BlockTableRecord blockTableRecord = acTrans.GetObject(entry, OpenMode.ForRead, true) as BlockTableRecord; |
291 |
if (blockTableRecord != null) |
292 |
{ |
293 |
IEnumerable<BlockReference> records = AcDbLinqExtensionMethods.GetBlockReferences(blockTableRecord); |
294 |
foreach (var item in records) |
295 |
{ |
296 |
if (item.Name == name) |
297 |
handles.Add(item.Handle.Value); |
298 |
} |
299 |
} |
300 |
} |
301 |
|
302 |
acTrans.Commit(); |
303 |
} |
304 |
return handles; |
305 |
} |
306 |
private List<long> GetAllGroupHandles() |
307 |
{ |
308 |
List<long> handles = new List<long>(); |
309 |
|
310 |
Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; |
311 |
Database acCurDb = acDoc.Database; |
312 |
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction()) |
313 |
{ |
314 |
DBDictionary gd = (DBDictionary)acTrans.GetObject(acCurDb.GroupDictionaryId, OpenMode.ForRead); |
315 |
foreach (var entry in gd) |
316 |
handles.Add(entry.Value.Handle.Value); |
317 |
acTrans.Commit(); |
318 |
} |
319 |
return handles; |
320 |
} |
321 |
private ObjectId GetFirstPolyLine(long groupHandle) |
322 |
{ |
323 |
ObjectId result = ObjectId.Null; |
324 |
|
325 |
Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; |
326 |
Database acCurDb = acDoc.Database; |
327 |
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction()) |
328 |
{ |
329 |
DBDictionary gd = (DBDictionary)acTrans.GetObject(acCurDb.GroupDictionaryId, OpenMode.ForRead); |
330 |
foreach (var entry in gd) |
331 |
{ |
332 |
if (entry.Value.Handle.Value == groupHandle) |
333 |
{ |
334 |
Autodesk.AutoCAD.DatabaseServices.Group group = acTrans.GetObject(entry.Value, OpenMode.ForRead) as Autodesk.AutoCAD.DatabaseServices.Group; |
335 |
foreach (var item in group.GetAllEntityIds()) |
336 |
{ |
337 |
if (acTrans.GetObject(item, OpenMode.ForRead).GetType() == typeof(Autodesk.AutoCAD.DatabaseServices.Polyline)) |
338 |
{ |
339 |
result = item; |
340 |
break; |
341 |
} |
342 |
} |
343 |
break; |
344 |
} |
345 |
} |
346 |
acTrans.Commit(); |
347 |
} |
348 |
|
349 |
return result; |
350 |
} |
351 |
private ObjectId GetObjectIdByHandle(long lHandle) |
352 |
{ |
353 |
Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; |
354 |
Database acCurDb = acDoc.Database; |
355 |
Handle handle = new Handle(lHandle); |
356 |
|
357 |
return acCurDb.GetObjectId(false, handle, 0); |
358 |
} |
359 |
private void SetBlockReferenceRotation(ObjectId objectId, double rotation) |
360 |
{ |
361 |
Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; |
362 |
Database acCurDb = acDoc.Database; |
363 |
Editor acDocEd = acDoc.Editor; |
364 |
|
365 |
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction()) |
366 |
{ |
367 |
DBObject objDB = acTrans.GetObject(objectId, OpenMode.ForWrite); |
368 |
if (objDB != null) |
369 |
{ |
370 |
if (objDB.GetType() == typeof(BlockReference)) |
371 |
{ |
372 |
BlockReference block = objDB as BlockReference; |
373 |
block.Rotation = rotation; |
374 |
} |
375 |
} |
376 |
acTrans.Commit(); |
377 |
} |
378 |
} |
379 |
#endregion |
380 |
|
381 |
#region Modeling Utils |
382 |
private void GetConnectedGroupLine(Model.Line line, List<Model.Line> group, bool isInsert) |
383 |
{ |
384 |
if (!group.Contains(line)) |
385 |
{ |
386 |
if (isInsert) |
387 |
group.Insert(0, line); |
388 |
else |
389 |
group.Add(line); |
390 |
|
391 |
if (line.CONNECTORS[0].ConnectedObject != null && !IsExistEndBreak(line, line.CONNECTORS[0].ConnectedObject)) |
392 |
{ |
393 |
object connObj = line.CONNECTORS[0].ConnectedObject; |
394 |
if (connObj.GetType() == typeof(Model.Line) && |
395 |
APIDUtils.IsConnectedLine(connObj as Model.Line, line)) |
396 |
GetConnectedGroupLine(connObj as Model.Line, group, true); |
397 |
else if (connObj.GetType() == typeof(Model.Symbol)) |
398 |
{ |
399 |
Model.Line connLine = FindOtherLineByRun(line, connObj as Symbol); |
400 |
if (connLine != null) |
401 |
GetConnectedGroupLine(connLine as Model.Line, group, true); |
402 |
} |
403 |
} |
404 |
if (line.CONNECTORS[1].ConnectedObject != null && !IsExistEndBreak(line, line.CONNECTORS[1].ConnectedObject)) |
405 |
{ |
406 |
object connObj = line.CONNECTORS[1].ConnectedObject; |
407 |
if (connObj.GetType() == typeof(Model.Line) && |
408 |
APIDUtils.IsConnectedLine(connObj as Model.Line, line)) |
409 |
GetConnectedGroupLine(connObj as Model.Line, group, false); |
410 |
else if (connObj.GetType() == typeof(Model.Symbol)) |
411 |
{ |
412 |
Model.Line connLine = FindOtherLineByRun(line, connObj as Symbol); |
413 |
if (connLine != null) |
414 |
GetConnectedGroupLine(connLine as Model.Line, group, false); |
415 |
} |
416 |
} |
417 |
} |
418 |
} |
419 |
private void GetGroupLinePoints(List<Model.Line> groupLine, List<string> points) |
420 |
{ |
421 |
for (int i = 0; i < groupLine.Count; i++) |
422 |
{ |
423 |
Model.Line line = groupLine[i]; |
424 |
if (i == 0) |
425 |
points.Add(line.Aveva.Start_X + "," + line.Aveva.Start_Y); |
426 |
else |
427 |
{ |
428 |
Model.Line prevLine = groupLine[i - 1]; |
429 |
if (line.SlopeType == SlopeType.HORIZONTAL && |
430 |
prevLine.SlopeType == SlopeType.VERTICAL) |
431 |
points.Add(prevLine.Aveva.End_X + "," + line.Aveva.Start_Y); |
432 |
else if (line.SlopeType == SlopeType.VERTICAL && |
433 |
prevLine.SlopeType == SlopeType.HORIZONTAL) |
434 |
points.Add(line.Aveva.Start_X + "," + prevLine.Aveva.End_Y); |
435 |
else |
436 |
points.Add(line.Aveva.Start_X + "," + line.Aveva.Start_Y); |
437 |
} |
438 |
|
439 |
if (i == groupLine.Count - 1) |
440 |
points.Add(line.Aveva.End_X + "," + line.Aveva.End_Y); |
441 |
} |
442 |
} |
443 |
private bool IsExistEndBreak(object item1, object item2) |
444 |
{ |
445 |
bool result = false; |
446 |
if (item1 != null && item2 != null) |
447 |
{ |
448 |
EndBreak endBreak = document.EndBreaks.Find(x => |
449 |
(APIDUtils.FindObjectByUID(document, x.OWNER) == item1 && |
450 |
APIDUtils.FindObjectByUID(document, x.PROPERTIES.Find(y => y.ATTRIBUTE == "Connected Item").VALUE) == item2) || |
451 |
(APIDUtils.FindObjectByUID(document, x.OWNER) == item2 && |
452 |
APIDUtils.FindObjectByUID(document, x.PROPERTIES.Find(y => y.ATTRIBUTE == "Connected Item").VALUE) == item1)); |
453 |
|
454 |
if (endBreak != null) |
455 |
result = true; |
456 |
} |
457 |
|
458 |
return result; |
459 |
} |
460 |
private LineRun FindLineRun(Model.Line line) |
461 |
{ |
462 |
List<LineRun> allLineRun = new List<LineRun>(); |
463 |
foreach (var item in document.LINENUMBERS) |
464 |
allLineRun.AddRange(item.RUNS); |
465 |
foreach (var item in document.TRIMLINES) |
466 |
allLineRun.AddRange(item.RUNS); |
467 |
|
468 |
return allLineRun.Find(x => x.RUNITEMS.Contains(line)); |
469 |
} |
470 |
private Model.Line FindOtherLineByRun(Model.Line line, Symbol symbol) |
471 |
{ |
472 |
Model.Line result = null; |
473 |
LineRun run = FindLineRun(line); |
474 |
Connector connector = symbol.CONNECTORS.Find(x => |
475 |
x.ConnectedObject != null && |
476 |
x.ConnectedObject != line && |
477 |
run.RUNITEMS.Contains(x.ConnectedObject) && |
478 |
x.ConnectedObject.GetType() == typeof(Model.Line)); |
479 |
|
480 |
if (connector != null) |
481 |
result = connector.ConnectedObject as Model.Line; |
482 |
|
483 |
return result; |
484 |
} |
485 |
#endregion |
486 |
|
487 |
#region Test Source |
488 |
public void test() |
489 |
{ |
490 |
//InitGUI(); |
491 |
//DrawSignal("SONIC", new List<string>() { "2,100", "100,100" }); |
492 |
|
493 |
DrawPipe("Main Pipe", new List<string>() { "2,100", "100,100" }); |
494 |
InsertSymbol("BAVA", 50, 100); |
495 |
//DrawPipe("Main Pipe", new List<string>() { "2,200", "100,200" }); |
496 |
|
497 |
//DrawPipe("Sub Pipe", new List<string>() { "50,100", "50,200" }); |
498 |
} |
499 |
public static void TESTStatic() |
500 |
{ |
501 |
AutoModeling auto = new AutoModeling(null); |
502 |
auto.test(); |
503 |
} |
504 |
#endregion |
505 |
} |
506 |
|
507 |
|
508 |
public static class AcDbLinqExtensionMethods |
509 |
{ |
510 |
/// <summary> |
511 |
/// Get all references to the given BlockTableRecord, including |
512 |
/// references to anonymous dynamic BlockTableRecords. |
513 |
/// </summary> |
514 |
|
515 |
public static IEnumerable<BlockReference> GetBlockReferences( |
516 |
this BlockTableRecord btr, |
517 |
OpenMode mode = OpenMode.ForRead, |
518 |
bool directOnly = true) |
519 |
{ |
520 |
if (btr == null) |
521 |
throw new ArgumentNullException("btr"); |
522 |
var tr = btr.Database.TransactionManager.TopTransaction; |
523 |
if (tr == null) |
524 |
throw new InvalidOperationException("No transaction"); |
525 |
var ids = btr.GetBlockReferenceIds(directOnly, true); |
526 |
int cnt = ids.Count; |
527 |
for (int i = 0; i < cnt; i++) |
528 |
{ |
529 |
yield return (BlockReference) |
530 |
tr.GetObject(ids[i], mode, false, false); |
531 |
} |
532 |
if (btr.IsDynamicBlock) |
533 |
{ |
534 |
BlockTableRecord btr2 = null; |
535 |
var blockIds = btr.GetAnonymousBlockIds(); |
536 |
cnt = blockIds.Count; |
537 |
for (int i = 0; i < cnt; i++) |
538 |
{ |
539 |
btr2 = (BlockTableRecord)tr.GetObject(blockIds[i], |
540 |
OpenMode.ForRead, false, false); |
541 |
ids = btr2.GetBlockReferenceIds(directOnly, true); |
542 |
int cnt2 = ids.Count; |
543 |
for (int j = 0; j < cnt2; j++) |
544 |
{ |
545 |
yield return (BlockReference) |
546 |
tr.GetObject(ids[j], mode, false, false); |
547 |
} |
548 |
} |
549 |
} |
550 |
} |
551 |
} |
552 |
} |