ExternalCommand

Hello guys,
I would like to run an external command from RoomBook. I found the command in journals:
CustomCtrl_%CustomCtrl_%Quantification%Areabook Extension%Calculate Areas:Adsk.DrxApplication.DrxAreaCalculationCmd

when I use RevitCommandId.LookupCommandId("CustomCtrl_%CustomCtrl_%Quantification%Areabook Extension%Calculate Areas") it opens the window but I can’t make it happen to click on “Calculate”

´

# Phython-Standard- und DesignScript-Bibliotheken laden
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitAPI","RevitAPIUI","RevitServices")
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager


doc = DocumentManager.Instance.CurrentDBDocument
uidoc = DocumentManager.Instance.CurrentUIDocument
uiapp = uidoc.Application

commandName = r"CustomCtrl_%CustomCtrl_%Quantification%Areabook Extension%Calculate Areas"
calculate = ""

test = RevitCommandId.LookupCommandId(commandName)


uiapp.PostCommand(test)

Its not possible to automate it. Not unless it has its own API, in which case you wont need to use the postable command.

1 Like

Thank you for reply Thomas! I tried to load dll and run that command but I could not do it. Alternatively I tried to use keyboard to apply command but in that case I can’t manage to use await in Python. I would change with Tab key to right button and then SendKey.Send("{ENTER}")…

How can I use await in Python 2.7?

Here is an example: