Hi,
in the case I need a sendcommand ... and I know it's executed when my current command ended I do the following:
The following is no code, just the structure!
private psr() as ObjectID 'dim the variable
Public sub myMainCommand
psr = ed.SelectLast 'save your selectionset
'BTW I don't know what "SelectLast" in your code is
... do anything
call sendCommand("DIMREGEN" & vbnewline)
... do anything
call sendCommand("DIMREGEN" & vbnewline)
'now the steps you need to get this workaround working
AddHandler for CommandEnded
call sendCommand("myDummyEndCommand")
End sub
Public sub myDummyEndCommand
...this is just to be defined
End sub
EventHandler for CommandEnded:
if CommandName = "myDummyEndCommand" then
RemoveHandler for CommandEnded
...do the jobs like
ed.SetImpliedSelection(psr.Value)
end if
So simplified described:
in your maincommand you place commands onto the comamnd-stack
when your main-command is finished the command-stack sends command by command (so your DIMREGENs or whatever else
and within your mainsub we have defined to run "myDummyEndCommand" as last command
and we have defined an eventhandler watching every single CommendEnded event
so if this handler now catches the command "myDummyEndCommand" the eventhandler knows that way your last command in the main-workflow and can now create a PickfirstSelectionSet/ImpliedSelection.
HTH, - alfred -
------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ...
blog.ish-solutions.at ...
LinkedIn ...
CDay 2026------------------------------------------------------------------------------------
(not an Autodesk consultant)