Currently doing family library project, already made WPF interface but because it was WPF project at start, intermediate interaction operations need to be implemented in Revit, thinking of driving Revit through WPF thereby implementing communication between two windows.

One way is generic, implemented using external event, this path is relatively easy
Another way is when reading jimmy‘s blog found a case, using WCF as connection to drive two independent programs.

Regarding creating WCF program can refer to Application

Both Console and Revit need administrator privileges to run, otherwise will report error unable to register endpoint

My code put on GitHub, only modified part about Revit. If official case cannot run can compare two cases to verify each other.

Through watching senior’s project, learned to use command line to quickly locate addin file, also understood reasons why some plugins cannot be seen in normal path

1
2
3
4
5
copy "$(ProjectDir)RevitExternalDemo.addin" "$(AppData)\Autodesk\REVIT\Addins\2016"
copy "$(TargetPath)" "$(AppData)\Autodesk\REVIT\Addins\2016"

copy "$(ProjectDir)RevitExternalDemo.addin" "$(AppData)\Autodesk\REVIT\Addins\2019"
copy "$(TargetPath)" "$(AppData)\Autodesk\REVIT\Addins\2019"