As far as switching selection priority between Component and Part, I don't think there is a built-in command just specifically for that, but as you said, it can definitely be done with a macro, and macros show up in the list of commands in the Customize dialog > Keyboard tab, so this definitely sounds doable. If all you need is the VBA macro code to accomplish this, here is something that works for me.
Sub ToggleAsmSelectionPriority()
If ThisApplication.ActiveDocumentType <> kAssemblyDocumentObject Then
Call MsgBox("An Assembly document must be active for this macro to work. Exiting.", , "")
Exit Sub
End If
Dim oADoc As AssemblyDocument
Set oADoc = ThisApplication.ActiveDocument
Dim oCurSelPriority As SelectionPriorityEnum
oCurSelPriority = oADoc.SelectionPriority
If oCurSelPriority = SelectionPriorityEnum.kPartSelectionPriority Then
oADoc.SelectionPriority = SelectionPriorityEnum.kComponentSelectionPriority
ElseIf oCurSelPriority = SelectionPriorityEnum.kComponentSelectionPriority Then
oADoc.SelectionPriority = SelectionPriorityEnum.kPartSelectionPriority
Else
oADoc.SelectionPriority = SelectionPriorityEnum.kComponentSelectionPriority
End If
End Sub
Setting up the shortcut thing can also very likely be set-up by code, but I doubt it would be a good idea to include that as part of the macro itself.
Is this what you were looking for?
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡or you can Explore My CONTRIBUTIONS
Wesley Crihfield

(Not an Autodesk Employee)