I can only think in 2 ways of doing it one is using PostCommand with the Windows Automation API.
public void PostableCommandExample()
{
UIDocument uidoc = this.ActiveUIDocument;
Document doc = uidoc.Document;
View view = doc.ActiveView;
uidoc.Application.PostCommand(RevitCommandId.LookupCommandId("Dialog_Essentials_SnapIncrements"));
}
Some resources:
https://thebuildingcoder.typepad.com/blog/2013/10/programmatic-custom-add-in-external-command-launch...
https://thebuildingcoder.typepad.com/blog/win32/
https://thebuildingcoder.typepad.com/blog/2017/12/magic-number-magic-automation-and-magic-season.htm...
and the other one using Revit Journal playback.
Jrn.RibbonEvent "TabActivated:Manage"
Jrn.Command "Ribbon" , "Modify snap distances or angles , ID_SETTINGS_SNAPPING"
Jrn.CheckBox "Modal , Snaps , Dialog_Essentials_SnapIncrements" _
, "Snap to Remote Objects, Control_Essentials_SnapDialogRemote" _
, False
Jrn.CheckBox "Modal , Snaps , Dialog_Essentials_SnapIncrements" _
, "Snap to Point Clouds, Control_Essentials_SnapDialogPointClouds" _
, False
Jrn.PushButton "Modal , Snaps , Dialog_Essentials_SnapIncrements" _
, "OK, IDOK"
some resources :
https://thebuildingcoder.typepad.com/blog/2009/07/journal-file-replay.html
https://forums.autodesk.com/t5/revit-ideas/journal-record-and-play/idi-p/7399668
Hope it helps 🙂
Hope it helps 🙂
-------------------------------------------------------------------------------------
www.faustomendez.com