Editor ImpliedSelection
Posted: Tue Dec 27, 2022 9:03 am
Trying to keep SelectionSet to impleidselection after a command ends, but it is not retaining the selectionset.
Objects selected after simple command does not keep selected.
Is ther a way to set the PROPERTIES filter objects ?
<CommandMethod("CheckForPickfirstSelection", CommandFlags.UsePickSet)>
Public Sub CheckForPickfirstSelection()
'' Get the current document
Dim acDocEd As Editor = Application.DocumentManager.MdiActiveDocument.Editor
'' Get the PickFirst selection set
Dim acSSPrompt As PromptSelectionResult
acSSPrompt = acDocEd.SelectImplied()
Dim acSSet As SelectionSet
'' If the prompt status is OK, objects were selected before
'' the command was started
If acSSPrompt.Status = PromptStatus.OK Then
acSSet = acSSPrompt.Value
Application.ShowAlertDialog("Number of objects in Pickfirst selection: " &
acSSet.Count.ToString())
Else
Application.ShowAlertDialog("Number of objects in Pickfirst selection: 0")
End If
'' Clear the PickFirst selection set
Dim idarrayEmpty(0) As ObjectId
acDocEd.SetImpliedSelection(idarrayEmpty)
'' Request for objects to be selected in the drawing area
acSSPrompt = acDocEd.GetSelection()
'' If the prompt status is OK, objects were selected
If acSSPrompt.Status = PromptStatus.OK Then
acSSet = acSSPrompt.Value
Application.ShowAlertDialog("Number of objects selected: " &
acSSet.Count.ToString())
acDocEd.SetImpliedSelection(acSSet)
Else
Application.ShowAlertDialog("Number of objects selected: 0")
End If
End Sub
Objects selected after simple command does not keep selected.
Is ther a way to set the PROPERTIES filter objects ?
<CommandMethod("CheckForPickfirstSelection", CommandFlags.UsePickSet)>
Public Sub CheckForPickfirstSelection()
'' Get the current document
Dim acDocEd As Editor = Application.DocumentManager.MdiActiveDocument.Editor
'' Get the PickFirst selection set
Dim acSSPrompt As PromptSelectionResult
acSSPrompt = acDocEd.SelectImplied()
Dim acSSet As SelectionSet
'' If the prompt status is OK, objects were selected before
'' the command was started
If acSSPrompt.Status = PromptStatus.OK Then
acSSet = acSSPrompt.Value
Application.ShowAlertDialog("Number of objects in Pickfirst selection: " &
acSSet.Count.ToString())
Else
Application.ShowAlertDialog("Number of objects in Pickfirst selection: 0")
End If
'' Clear the PickFirst selection set
Dim idarrayEmpty(0) As ObjectId
acDocEd.SetImpliedSelection(idarrayEmpty)
'' Request for objects to be selected in the drawing area
acSSPrompt = acDocEd.GetSelection()
'' If the prompt status is OK, objects were selected
If acSSPrompt.Status = PromptStatus.OK Then
acSSet = acSSPrompt.Value
Application.ShowAlertDialog("Number of objects selected: " &
acSSet.Count.ToString())
acDocEd.SetImpliedSelection(acSSet)
Else
Application.ShowAlertDialog("Number of objects selected: 0")
End If
End Sub