Private Sub CommandButton2_Click() Dim sset As AcadSelectionSet Set sset = ThisDrawing.SelectionSets.Add("a") sset.SelectOnScreen Dim entry As AcadEntity entry = sset.Item(sset.Count + 1) MsgBox ("this is a" & entry.ObjectName) End Sub
Function CreateSelectionSet(Optional SSetName As String = "mjtd") As AcadSelectionSet On Error Resume Next ThisDrawing.SelectionSets(SSetName).Delete Set CreateSelectionSet = ThisDrawing.SelectionSets.Add(SSetName) End Function Private Sub CommandButton2_Click() Dim SSet As AcadSelectionSet Set SSet = CreateSelectionSet SSet.SelectOnScreen Dim entry As AcadEntity entry = SSet.Item(SSet.Count - 1) MsgBox ("this is a") MsgBox (entry.ObjectName) End Sub
Private Sub CommandButton2_Click() Dim returnObj As AcadObject Dim basePnt As Variant ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object" End Sub