- Launch the command in the Revit UI
- Look at the end of the journal file
- you will find something like
Execute external command
and what is following between the two:
can be taken to replace the string in the last line of the following sample
# encoding: utf-8
from pyrevit import HOST_APP, UI
uiapp = HOST_APP.uiapp
uiapp.PostCommand(UI.RevitCommandId.LookupCommandId("CustomCtrl_%CustomCtrl_%CustomCtrl_%Add-Ins%Revit Lookup%Options%RevitLookup.Commands.SnoopActiveViewCommand"))
for Reference, read the following https://jeremytammik.github.io/tbc/a/1040_postcommand.htm
and see code samples in C# here
GitHub - jeremytammik/PostAddinCommand: Test programmatic posting of an external command defined by a custom Revit add-in.