개정판 5c05308b
dev issue #1231 : add symbol uda attribute method
Change-Id: I57b6a3462b6de2eea97c5f132b503ae109cd8cf6
DTI_PID/APIDConverter/AutoModeling.cs | ||
---|---|---|
6 | 6 |
using System.Data.Common; |
7 | 7 |
using System.Data.SqlClient; |
8 | 8 |
using System.IO; |
9 |
using System.Runtime.CompilerServices; |
|
10 |
using Microsoft.VisualBasic.CompilerServices; |
|
9 | 11 |
|
10 | 12 |
using Autodesk.AutoCAD.ApplicationServices; |
11 | 13 |
using Autodesk.AutoCAD.ApplicationServices.Core; |
... | ... | |
178 | 180 |
SplashScreenManager.Default.SendCommand(APIDSplashScreen.SplashScreenCommand.UpProgress, null); |
179 | 181 |
} |
180 | 182 |
} |
183 |
private void RunInputLineAttribute() |
|
184 |
{ |
|
185 |
|
|
186 |
} |
|
187 |
private void RunInputSymbolAttribute() |
|
188 |
{ |
|
189 |
|
|
190 |
} |
|
181 | 191 |
#endregion |
182 | 192 |
|
183 | 193 |
#region Modeling Method |
... | ... | |
300 | 310 |
} |
301 | 311 |
} |
302 | 312 |
} |
313 |
private void SetLineAttribute(Model.Line line) |
|
314 |
{ |
|
315 |
|
|
316 |
} |
|
317 |
private void SetSymbolAttribute(Model.Symbol symbol) |
|
318 |
{ |
|
319 |
|
|
320 |
} |
|
303 | 321 |
#endregion |
304 | 322 |
|
305 | 323 |
#region Drawing Method |
... | ... | |
606 | 624 |
acTrans.Commit(); |
607 | 625 |
} |
608 | 626 |
} |
627 |
private void SetSymbolUDAAttribute(ObjectId objectId, List<Tuple<string, string>> datas) |
|
628 |
{ |
|
629 |
AcadApplication acadApplication = Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication as Autodesk.AutoCAD.Interop.AcadApplication; |
|
630 |
AcadBlockReference acadBlockReference = acadApplication.ActiveDocument.ObjectIdToObject((long)objectId.OldIdPtr); |
|
631 |
if (acadBlockReference.HasAttributes) |
|
632 |
{ |
|
633 |
object objectValue = RuntimeHelpers.GetObjectValue(acadBlockReference.GetAttributes()); |
|
634 |
int arg_5B_0 = Microsoft.VisualBasic.Information.LBound((Array)objectValue, 1); |
|
635 |
int num = Microsoft.VisualBasic.Information.UBound((Array)objectValue, 1); |
|
636 |
for (int i = arg_5B_0; i <= num; i++) |
|
637 |
{ |
|
638 |
string text = string.Empty; |
|
639 |
text = Conversions.ToString(NewLateBinding.LateGet(NewLateBinding.LateIndexGet(objectValue, new object[] |
|
640 |
{ |
|
641 |
i |
|
642 |
}, null), null, "tagString", new object[0], null, null, null)); |
|
643 |
|
|
644 |
Tuple<string, string> attribute = datas.Find(x => x.Item1 == text); |
|
645 |
if (attribute != null) |
|
646 |
{ |
|
647 |
NewLateBinding.LateSetComplex(NewLateBinding.LateIndexGet(objectValue, new object[] |
|
648 |
{ |
|
649 |
i |
|
650 |
}, null), null, "textString", new object[] |
|
651 |
{ |
|
652 |
attribute.Item2.Split("|".ToCharArray())[0] |
|
653 |
}, null, null, false, true); |
|
654 |
} |
|
655 |
} |
|
656 |
} |
|
657 |
} |
|
609 | 658 |
#endregion |
610 | 659 |
|
611 | 660 |
#region Modeling Utils |
... | ... | |
857 | 906 |
|
858 | 907 |
//DrawPipe("Sub Pipe", new List<string>() { "50,100", "50,200" }); |
859 | 908 |
} |
860 |
public static void TESTStatic() |
|
909 |
public static void TESTStatic(ObjectId objectId)
|
|
861 | 910 |
{ |
862 |
System.Data.DataTable avevaSymbolTable = Project_DB.SelectSymbolTable(); |
|
863 |
AutoModeling auto = new AutoModeling(null, avevaSymbolTable); |
|
864 |
auto.test(); |
|
911 |
// Get the current document and database, and start a transaction |
|
912 |
Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; |
|
913 |
Database acCurDb = acDoc.Database; |
|
914 |
Editor acDocEd = acDoc.Editor; |
|
915 |
|
|
916 |
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction()) |
|
917 |
{ |
|
918 |
Entity objDb = (Entity)acTrans.GetObject(objectId, OpenMode.ForWrite); |
|
919 |
Entity startNodeEntityForPipe = Pipe.GetStartNodeEntityForPipe(objDb); |
|
920 |
|
|
921 |
ArrayList arrayList = new ArrayList(); |
|
922 |
ArrayList arrayList2 = new ArrayList(); |
|
923 |
PIDUtils.VBUtils.GetUserDefineAttributes(startNodeEntityForPipe.ObjectId, ref arrayList, ref arrayList2); |
|
924 |
PIDUtils.VBUtils.GetUserDefineAttributes(objDb.ObjectId, ref arrayList, ref arrayList2); |
|
925 |
NamedXDataBlock namedXDataBlock = XDataUtilities.GetNamedBlock(objDb, "ReferenceObject"); |
|
926 |
acTrans.Commit(); |
|
927 |
} |
|
928 |
|
|
929 |
|
|
865 | 930 |
} |
866 | 931 |
#endregion |
867 | 932 |
} |
내보내기 Unified diff