It looks like you're new here. If you want to get involved, click one of these buttons!
When I customise a command or call a selfwritten routine I usually prefix the call with:
_select;$m=$(if,$(eq,$(getvar,cmdnames),),,\)_[command] (where [command] is replaced with the routine name or the function)
This way the routine (or command) is applied to the current selection (if anything selected) or the selection can be made after clicking the customized button.
This works in AutoCAD. Can this be made to work in Bricscad as well?