프로젝트

일반

사용자정보

개정판 6b3cb476

ID6b3cb476df67c42b815d8baab93e3f0897d72087
상위 eea44d8f
하위 345bd773

gaqhf 이(가) 5년 이상 전에 추가함

dev issue #1231 : add default symbol modeling source

Change-Id: I890310a081a25531330741dc984782b9318c79c7

차이점 보기:

DTI_PID/APIDConverter/AVEVA.PID.CustomizationUtility_ACAD2018_x64.csproj
72 72
      <HintPath>C:\Program Files\AVEVA\P&amp;ID 12.2.SP1\Install\Exe\AVEVA.PID.GUI.dll</HintPath>
73 73
      <Private>False</Private>
74 74
    </Reference>
75
    <Reference Include="AVEVA.PID.Utilities, Version=12.2.1.2, Culture=neutral, processorArchitecture=AMD64">
76
      <SpecificVersion>False</SpecificVersion>
77
      <HintPath>C:\Program Files\AVEVA\P&amp;ID 12.2.SP1\Install\Exe\AVEVA.PID.Utilities.dll</HintPath>
78
      <Private>False</Private>
79
    </Reference>
75 80
    <Reference Include="DevExpress.Data.v18.2, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
76 81
    <Reference Include="DevExpress.Dialogs.v18.2.Core, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
77 82
    <Reference Include="DevExpress.Printing.v18.2.Core, Version=18.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
......
86 91
    <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
87 92
      <SpecificVersion>False</SpecificVersion>
88 93
      <HintPath>C:\Program Files\AVEVA\P&amp;ID 12.2.SP1\Install\Exe\Newtonsoft.Json.dll</HintPath>
94
      <Private>False</Private>
89 95
    </Reference>
90 96
    <Reference Include="PresentationCore" />
91 97
    <Reference Include="PresentationFramework" />
DTI_PID/APIDConverter/AutoModeling.cs
109 109
        }
110 110

  
111 111
        #region Drawing Method
112

  
113 112
        private string DrawPipe(string style, List<string> coordinates)
114 113
        {
115 114
            SetPipeStyle(style);
......
160 159

  
161 160
            editor.Command(commandParam.ToArray());
162 161
        }
162
        private void InsertSymbol(string insertSymbolName, double x, double y)
163
        {
164
            try
165
            {
166
                AVEVA.PID.Utilities.DrawingData drawingData = new AVEVA.PID.Utilities.DrawingData();
167
                drawingData.InsertSymbolName = insertSymbolName;
168
                Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
169
                Editor editor = acDoc.Editor;
170
                List<object> commandParam = new List<object>();
171
                commandParam.Add("INSSYM");
172
                Point3d point = new Point3d(x, y, 0);
173
                commandParam.Add(point);
174
                commandParam.Add(null);
175

  
176
                editor.Command(commandParam.ToArray());
177
            }
178
            catch (System.Exception ex)
179
            {
163 180

  
181
            }
182
        }
164 183
        #endregion
165 184

  
166 185
        #region Test Source
DTI_PID/APIDConverter/Form/APIDConverter.cs
62 62
            #endregion
63 63
        }
64 64

  
65

  
66 65
        private void btnLoadFile_Click(object sender, EventArgs e)
67 66
        {
68 67
            Project_Info _ProjectInfo = Project_Info.GetInstance();
DTI_PID/APIDConverter/PIDCustomization.cs
390 390
            }
391 391
        }
392 392
        #endregion
393

  
394

  
395

  
396
        #region TEST
397
        [CommandMethod("TestS", Autodesk.AutoCAD.Runtime.CommandFlags.UsePickSet)]
398
        public static void TestSelection()
399
        {
400
            // Get the current document and database, and start a transaction
401
            Autodesk.AutoCAD.ApplicationServices.Document acDoc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
402
            Database acCurDb = acDoc.Database;
403
            Editor acDocEd = acDoc.Editor;
404

  
405
            // Request for objects to be selected in the drawing area
406
            PromptSelectionResult acSSPrompt = acDocEd.GetSelection();
407

  
408
            // If the prompt status is OK, objects were selected
409
            if (acSSPrompt.Status == PromptStatus.OK)
410
            {
411
                ObjectId[] selectedObjectIds = acSSPrompt.Value.GetObjectIds();
412
                // Get the last selected entity
413

  
414
                if (selectedObjectIds.Length > 0)
415
                {
416
                    ObjectId objIdBlock = selectedObjectIds[0];
417
                    using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
418
                    {
419
                        DBObject objDB = acTrans.GetObject(objIdBlock, OpenMode.ForRead, true);
420
                        if (objDB != null)
421
                        {
422
                            // check if the selected entity is of Type BlockReference
423
                            if (objDB.GetType() == typeof(BlockReference))
424
                            {
425
                                BlockReference block = objDB as BlockReference;
426

  
427
                                // open an entity in write mode so that we can modify its color
428
                                //Entity objDb = (Entity)acTrans.GetObject(objIdBlock, OpenMode.ForWrite);
429
                                //if (objDb != null)
430
                                //{
431
                                //    objDb.ColorIndex = 0;// white color
432
                                //}
433
                            }
434
                        }
435
                        acTrans.Commit();
436
                    }
437
                }
438
            }
439
        }
440

  
441

  
442
        #endregion
393 443
    }
394 444
}

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)