프로젝트

일반

사용자정보

개정판 6b3cb476

ID6b3cb476df67c42b815d8baab93e3f0897d72087
상위 eea44d8f
하위 345bd773

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

dev issue #1231 : add default symbol modeling source

Change-Id: I890310a081a25531330741dc984782b9318c79c7

차이점 보기:

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)