개정판 5c05308b
dev issue #1231 : add symbol uda attribute method
Change-Id: I57b6a3462b6de2eea97c5f132b503ae109cd8cf6
DTI_PID/APIDConverter/AVEVA.PID.CustomizationUtility_ACAD2018_x64.csproj | ||
---|---|---|
98 | 98 |
<HintPath>C:\Program Files\AVEVA\P&ID 12.2.SP1\Install\Exe\AVEVA.PID.Utilities.dll</HintPath> |
99 | 99 |
<Private>False</Private> |
100 | 100 |
</Reference> |
101 |
<Reference Include="AVEVA.PID.VBUtils, Version=12.2.1.2, Culture=neutral, processorArchitecture=AMD64"> |
|
102 |
<SpecificVersion>False</SpecificVersion> |
|
103 |
<HintPath>C:\Program Files\AVEVA\P&ID 12.2.SP1\Install\Exe\AVEVA.PID.VBUtils.dll</HintPath> |
|
104 |
<Private>False</Private> |
|
105 |
</Reference> |
|
101 | 106 |
<Reference Include="DevExpress.Data.v18.2, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> |
102 | 107 |
<Reference Include="DevExpress.Dialogs.v18.2.Core, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> |
103 | 108 |
<Reference Include="DevExpress.Printing.v18.2.Core, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> |
... | ... | |
109 | 114 |
<Reference Include="DevExpress.XtraGrid.v18.2, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> |
110 | 115 |
<Reference Include="DevExpress.XtraLayout.v18.2, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" /> |
111 | 116 |
<Reference Include="DevExpress.XtraTreeList.v18.2, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" /> |
117 |
<Reference Include="Microsoft.CSharp" /> |
|
112 | 118 |
<Reference Include="Microsoft.VisualBasic" /> |
113 | 119 |
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> |
114 | 120 |
<SpecificVersion>False</SpecificVersion> |
... | ... | |
124 | 130 |
<Reference Include="System.Data.Linq" /> |
125 | 131 |
<Reference Include="System.Data.SQLite, Version=1.0.111.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> |
126 | 132 |
<HintPath>..\packages\System.Data.SQLite.Core.1.0.111.0\lib\net46\System.Data.SQLite.dll</HintPath> |
133 |
<Private>True</Private> |
|
127 | 134 |
</Reference> |
128 | 135 |
<Reference Include="System.Deployment" /> |
129 | 136 |
<Reference Include="System.Drawing" /> |
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 |
} |
DTI_PID/APIDConverter/PIDCustomization.cs | ||
---|---|---|
423 | 423 |
|
424 | 424 |
//GUIUtils.SetAutoLabelCheck(false); |
425 | 425 |
////APIDUtils.CreateDrawingAndOpen("testA1", "1", "Aveva-Metric", "1"); |
426 |
AutoModeling.TESTStatic(); |
|
426 |
|
|
427 | 427 |
|
428 | 428 |
AccessPropertyForm.Stop(); |
429 | 429 |
} |
... | ... | |
448 | 448 |
if (selectedObjectIds.Length > 0) |
449 | 449 |
{ |
450 | 450 |
ObjectId objIdBlock = selectedObjectIds[0]; |
451 |
AutoModeling.TESTStatic(objIdBlock); |
|
451 | 452 |
|
452 | 453 |
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction()) |
453 | 454 |
{ |
내보내기 Unified diff