Message 1 of 4
Revit Run in Automation Mode
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Everyone and thank you.
I have a powershell script that will load a revit application and most likely will call a revit plugin. Below is my powershell script, addin and the class of my plugin.
# Path to Revit EXE
$revitExe = "C:\Program Files\Autodesk\Revit 2024\Revit.exe"
# Path to your generated journal
$journalPath = "C:\Users\xxxx\AppData\Local\Temp\revit_auto_6e7001a415554ea7af4fb16612599dd9\auto_journal.txt"
# Start Revit with /automation
$tempDir = "C:\Users\xxxx\AppData\Local\Temp\revit_auto_6e7001a415554ea7af4fb16612599dd9"
Start-Process -FilePath $revitExe -ArgumentList "/automation `"$journalPath`"" -WorkingDirectory $tempDir -Wait
addin file
<?xml version="1.0" encoding="utf-8"?>
<RevitAddIns>
<AddIn Type="Command">
<Name>BatchKeynoteUpdater</Name>
<Assembly>C:\Users\xxxx\source\repos\version app.dll</Assembly>
<AddInId>xxxx</AddInId> <FullClassName>app.UpdaterCommand</FullClassName>
<VendorId>x</VendorId>
<Publisher>x</Publisher>
<VendorDescription>x</VendorDescription>
<CommandType>Automation</CommandType>
</AddIn>
</RevitAddIns>
namespace app
{
[Transaction(TransactionMode.Manual)]
public class UpdaterCommand : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
log("this is called");
}
}
}
My problem here is that the updatercommand execute was never called at all by using the powershell script. Doing this manually or clicking the revit plugin works.
I am kinda stuck on this scenario. Before I posted here I tried to look for answers via AI and I exhausted all the recommendation.
If anyone has idea feel free to commend and thank you in advance.