Skip to content
English
  • There are no suggestions because the search field is empty.

iLogic "RunRule" and "RunExternalRule" do not work in powerJobs Processor with Inventor 2025 or newer

Issue

Running iLogic rules in a custom powerJobs Processor job using for example "RunRule" or "RunExternalRule" does not work with Inventor 2025. The command fails with the following message:

Solution 1

Translate iLogic to PowerShell

Translate the iLogic script to PowerShell and run it directly in your job script. You can access the Inventor API using the return value of the Open-Document Cmdlet:

$openResult = Open-Document -LocalFile "C:\Temp\Drawing1.idw"
# The Inventor document
$document = $openResult.Document.Instance
# The application
$application = $openResult.Application.Instance

Solution 2

Use the following code to run iLogic rules via PowerShell:

$openResult = Open-Document -LocalFile "C:\Temp\Drawing1.idw"
# The Inventor document
$document = $openResult.Document.Instance
# The application
$application = $openResult.Application.Instance
$addIn = $Application.ApplicationAddIns.ItemById("{3bdd8d79-2179-4b11-8a5a-257b1c0263ac}")
$addIn.Activate()
$iLogicAutomation = $addIn.Automation()
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.VisualBasic")
$rules = [Microsoft.VisualBasic.CompilerServices.NewLateBinding]::LateGet($iLogicAutomation, $null, "Rules", $Document, $null , $null, $null)
foreach ($rule in $rules) {
   [Microsoft.VisualBasic.CompilerServices.NewLateBinding]::LateGet($iLogicAutomation, $null, "RunruleDirect", $rule, $null , $null, $null)
}

See Also

Open-Document documentation