C : VBA  July 07, 2005

●図形の選択2

図形選択の方法2

対話しながらの選択
____________________________________________

1、シングル選択

GetEntity メソッド
GetSubEntity メソッド

2、SelectOnScreen メソッド
  「オブジェクト選択:」を表示

3、Select メソッド
     Getxxxメソッドで予め点を取り組合わせ利用
  モード
  acSelectionSetWindow
  acSelectionSetCrossing
  acSelectionSetPrevious
  acSelectionSetLast
  acSelectionSetAll

  SelectByPolygon メソッド
  モード
  acSelectionSetFence
  acSelectionSetWindowPolygon
  acSelectionSetCrossingPolygon 

  SelectAtPoint メソッド
____________________________________________

Sub Example_Select2()

    Dim SSet As AcadSelectionSet '選択Set 選択図形をほうりこむ箱
                                 '"SS1"は箱の名前(なんでも良い)
    Dim acadObj As AcadObject
   
 On Error Resume Next  'Errorがあっても次に進む
 ' Eorror処理 もし同じ選択Setがあったら削除
 If Not IsNull(ThisDrawing.SelectionSets.Item("SS1")) Then
    Set SSet = ThisDrawing.SelectionSets.Item("SS1")
    SSet.Delete
 End If
   
    Set SSet = ThisDrawing.SelectionSets.Add("SS1")
    '選択Setを図面に追加
   
    SSet.SelectOnScreen
    '画面上で図形選択
  
For Each acadObj In SSet
    Debug.Print acadObj.ObjectName
Next

End Sub

Posted by m_eguchi at July 7, 2005 06:13 PM
トラックバックURL

このエントリーのトラックバックURL:
http://www.kkkxcec.com/supportwlog/mt-tb.cgi/27