@Maxim-CADman77,
Would you have any example code you could share?
I used @Curtis_Waguespack add-in template to create an add-in for Inventor 2025. (some edits required for compatibility)
I copied the original Run_External_iLogic_Rule.vb and modified it to not require a document argument:
Module Run_External_iLogic_Rule_NoDoc
Public Sub RunExternalRule(ByVal ExternalRuleName As String)
Try
' The application object.
Dim addIns As ApplicationAddIns = g_inventorApplication.ApplicationAddIns()
' Unique ID code for iLogic Addin
Dim iLogicAddIn As ApplicationAddIn = addIns.ItemById("{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}")
' Starts the process
iLogicAddIn.Activate()
' Executes the rule
' iLogicAddIn.Automation.RunExternalRule(g_inventorApplication.ActiveDocument, ExternalRuleName)
iLogicAddIn.Automation.RunExternalRule(ExternalRuleName) ' << ERROR HERE
...
I call the new sub when the button executes:
'This is the code that does the real work when your command is executed.
Sub Run_ExternalRule()
MessageBox.Show("This command creates a new assembly from the ZeroDoc environment via External Rule.", "Create New Assembly", MessageBoxButtons.OK, MessageBoxIcon.Information)
Run_External_iLogic_Rule_NoDoc.RunExternalRule("\\EngServer\inventor_data\Support\iLogic\CreateNewAssemblyFromZeroDoc.iLogicVb")
End Sub
Currently, an error occurs when the code gets to the 'RunExternalRule' line.
Again, any examples you could share that show how to run an external rule from the ZeroDoc environment would be appreciated.
Regards,
Jerry
-----------------------------------------------------------------------------------------
CAD Administrator
Using AutoCAD & Inventor 2025
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional