I would create the macro in AutoCAD and use shortcut keys and then trigger that from the Spacemouse.
In AutoCAD open CUI create a new command. It will default to command1. Click that command.

That will open up the properties. Here you give it a name and enter the AutoCAD macro then click apply.

Next click that command and drag it to the short cut keys area.

Then in the shortcut area, assign the Key combination. Then click apply.

You can test your key combination in AutoCAD at this point to make sure it operate the way you intend.
If it doesn't work, fix it before proceeding.
Once your macro working in AutoCAD you can then assign it in the 3D connection.
Open your 3D Connexion Settings. Remember that its specfic to the program so make sure that AutoCAD is showing in the dialog, then click Buttons.

Next click the button to assign and either create a new one or edit one.

There enter your key combination from AutoCAD.

Click save.
Now when you click that button in the program it should trigger the macro that you created in AutoCAD.
CADnoob
