개정판 aabc2b2d
dev issue #000 : add ribbon tab
Change-Id: I52be222543ab338ee6d03d35cd44f67a2c3cfd63
DTI_PID/APIDConverter/AVEVA.PID.CustomizationUtility_ACAD2018_x64.csproj | ||
---|---|---|
39 | 39 |
<ItemGroup> |
40 | 40 |
<Reference Include="accoremgd"> |
41 | 41 |
<HintPath>C:\Program Files\Autodesk\AutoCAD 2018\accoremgd.dll</HintPath> |
42 |
<Private>False</Private> |
|
42 | 43 |
</Reference> |
43 | 44 |
<Reference Include="acdbmgd"> |
44 | 45 |
<HintPath>C:\Program Files\Autodesk\AutoCAD 2018\acdbmgd.dll</HintPath> |
46 |
<Private>False</Private> |
|
45 | 47 |
</Reference> |
46 | 48 |
<Reference Include="acmgd"> |
47 | 49 |
<HintPath>C:\Program Files\Autodesk\AutoCAD 2018\acmgd.dll</HintPath> |
50 |
<Private>False</Private> |
|
51 |
</Reference> |
|
52 |
<Reference Include="AcWindows"> |
|
53 |
<HintPath>C:\Program Files\Autodesk\AutoCAD 2018\AcWindows.dll</HintPath> |
|
54 |
<Private>False</Private> |
|
48 | 55 |
</Reference> |
49 | 56 |
<Reference Include="AdWindows"> |
50 | 57 |
<HintPath>C:\Program Files\Autodesk\AutoCAD 2018\AdWindows.dll</HintPath> |
58 |
<Private>False</Private> |
|
51 | 59 |
</Reference> |
52 | 60 |
<Reference Include="Autodesk.AutoCAD.Interop"> |
53 | 61 |
<HintPath>C:\Program Files\Autodesk\AutoCAD 2018\Autodesk.AutoCAD.Interop.dll</HintPath> |
... | ... | |
57 | 65 |
<HintPath>C:\Program Files\Autodesk\AutoCAD 2018\Autodesk.AutoCAD.Interop.Common.dll</HintPath> |
58 | 66 |
<EmbedInteropTypes>True</EmbedInteropTypes> |
59 | 67 |
</Reference> |
68 |
<Reference Include="AVEVA.PID.GUI, Version=12.2.1.2, Culture=neutral, processorArchitecture=AMD64"> |
|
69 |
<SpecificVersion>False</SpecificVersion> |
|
70 |
<HintPath>C:\Program Files\AVEVA\P&ID 12.2.SP1\Install\Exe\AVEVA.PID.GUI.dll</HintPath> |
|
71 |
<Private>False</Private> |
|
72 |
</Reference> |
|
60 | 73 |
<Reference Include="Microsoft.VisualBasic" /> |
74 |
<Reference Include="PresentationCore" /> |
|
75 |
<Reference Include="PresentationFramework" /> |
|
61 | 76 |
<Reference Include="System" /> |
62 | 77 |
<Reference Include="System.Core" /> |
63 | 78 |
<Reference Include="System.Windows.Forms" /> |
79 |
<Reference Include="System.Xaml" /> |
|
64 | 80 |
<Reference Include="System.Xml.Linq" /> |
65 | 81 |
<Reference Include="System.Data.DataSetExtensions" /> |
66 | 82 |
<Reference Include="System.Data" /> |
67 | 83 |
<Reference Include="System.Xml" /> |
84 |
<Reference Include="WindowsBase" /> |
|
68 | 85 |
</ItemGroup> |
69 | 86 |
<ItemGroup> |
87 |
<Compile Include="AutoModeling.cs" /> |
|
70 | 88 |
<Compile Include="Aveva.PID.AssemblyInfo.cs" /> |
89 |
<Compile Include="ConverterRibbonUI.cs" /> |
|
90 |
<Compile Include="DB\DB.cs" /> |
|
71 | 91 |
<Compile Include="PIDCustomization.cs" /> |
72 | 92 |
<Compile Include="Properties\AssemblyInfo.cs" /> |
73 | 93 |
<Compile Include="Utilities.cs" /> |
DTI_PID/APIDConverter/PIDCustomization.cs | ||
---|---|---|
87 | 87 |
/// <summary> |
88 | 88 |
/// This is test command which gives the idea regarding selection of an entity and assigning different color to it |
89 | 89 |
/// </summary> |
90 |
[CommandMethod("TestS", Autodesk.AutoCAD.Runtime.CommandFlags.UsePickSet)]
|
|
90 |
[CommandMethod("TestS")] |
|
91 | 91 |
public static void TestSelection() |
92 | 92 |
{ |
93 |
// Get the current document and database, and start a transaction |
|
94 |
Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument; |
|
95 |
Database acCurDb = acDoc.Database; |
|
96 |
Editor acDocEd = acDoc.Editor; |
|
93 |
ConverterRibbonUI.InitUI(); |
|
97 | 94 |
|
98 |
// Request for objects to be selected in the drawing area |
|
99 |
PromptSelectionResult acSSPrompt = acDocEd.GetSelection(); |
|
100 |
|
|
101 |
// If the prompt status is OK, objects were selected |
|
102 |
if (acSSPrompt.Status == PromptStatus.OK) |
|
103 |
{ |
|
104 |
ObjectId[] selectedObjectIds = acSSPrompt.Value.GetObjectIds(); |
|
105 |
// Get the last selected entity |
|
106 |
|
|
107 |
if (selectedObjectIds.Length > 0) |
|
108 |
{ |
|
109 |
ObjectId objIdBlock = selectedObjectIds[0]; |
|
110 |
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction()) |
|
111 |
{ |
|
112 |
DBObject objDB = acTrans.GetObject(objIdBlock, OpenMode.ForRead, true); |
|
113 |
if (objDB != null) |
|
114 |
{ |
|
115 |
// check if the selected entity is of Type BlockReference |
|
116 |
if (objDB.GetType() == typeof(BlockReference)) |
|
117 |
{ |
|
118 |
// open an entity in write mode so that we can modify its color |
|
119 |
Entity objDb = (Entity)acTrans.GetObject(objIdBlock, OpenMode.ForWrite); |
|
120 |
if (objDb != null) |
|
121 |
{ |
|
122 |
objDb.ColorIndex = 0;// white color |
|
123 |
} |
|
124 |
} |
|
125 |
} |
|
126 |
acTrans.Commit(); |
|
127 |
} |
|
128 |
} |
|
129 |
} |
|
95 |
//AutoModeling.TEST(); |
|
96 |
} |
|
97 |
[CommandMethod("ConverterForm")] |
|
98 |
public static void Test2() |
|
99 |
{ |
|
100 |
MessageBox.Show("HI"); |
|
130 | 101 |
} |
131 |
|
|
132 | 102 |
#region private methods |
133 | 103 |
private string SaveBinaryDrawing() |
134 | 104 |
{ |
DTI_PID/APIDConverter/Utils/GUIUtils.cs | ||
---|---|---|
4 | 4 |
using System.Text; |
5 | 5 |
using System.Threading.Tasks; |
6 | 6 |
|
7 |
namespace Converter.AVEVA.Util
|
|
7 |
namespace AVEVA.PID.CustomizationUtility
|
|
8 | 8 |
{ |
9 | 9 |
public class GUIUtils |
10 | 10 |
{ |
내보내기 Unified diff