Hi guys. Not sure how you may need to make this happen as far as any further automation plans go, but there may be another, more direct way. Since around Inventor 2021 or so, we can use an iLogic tool that will allow us to initialize many of the common iLogic API code snippets with an actual Document object for them to be referencing, to help clarify which document they will be focused on.
StandardObjectFactory Class
StandardObjectFactory.Create Method
IStandardObjectProvider Interface
Review the following iLogic rule code example, to try it out. The first couple lines let you manually select an assembly component, and if none was selected, it will exit the rule. If one was selected, it attempts to get the Document object that the assembly component is referencing, so that we can access the internal iLogic Form within it. Once it has the Document, it uses the create object provider method to create an object provider, with that Document as input (specified which document it should focus on). Then it uses that provider to show the internal iLogic form within that document. However, you will need to change "Form 1" to the actual name of the form within that document.
Dim oOcc As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Select Component - or press ESC key to quit.")
If oOcc Is Nothing Then Return 'Return means exit this code routine
Dim oOccDoc As Document = oOcc.ReferencedDocumentDescriptor.ReferencedDocument
Dim SOP As IStandardObjectProvider = iLogicVb.CreateObjectProvider(oOccDoc)
SOP.iLogicForm.Show("Form 1", FormMode.Modal)
If the name of the form changes, then you will likely need a more complex code solution which will be able to find the form by some other means than by its name. If there is only one form in the document, then there is actually still a way to do that without getting super complicated. Something like the following maybe.
Dim oOcc As ComponentOccurrence = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Select Component - or press ESC key to quit.")
If oOcc Is Nothing Then Return 'Return means exit this code routine
Dim oOccDoc As Document = oOcc.ReferencedDocumentDescriptor.ReferencedDocument
Dim SOP As IStandardObjectProvider = iLogicVb.CreateObjectProvider(oOccDoc)
Dim oFormNames As IEnumerable(Of String) = SOP.iLogicForm.FormNames
If oFormNames IsNot Nothing Then
Dim sFormName As String = oFormNames.ElementAt(0)
SOP.iLogicForm.Show(sFormName, FormMode.Modal)
End If
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)