Call iLogic Form Via API

Call iLogic Form Via API

matt_jlt
Collaborator Collaborator
2,228 Views
1 Reply
Message 1 of 2

Call iLogic Form Via API

matt_jlt
Collaborator
Collaborator

I've read lots of posts with no answers and was wondering, is it possible to call up an iLogic form via the API?

 

I have an iLogic form which is in a part. That part is in an assembly which gets called up on an IDW.

So the structure looks like this: IDW > IAM > IPT : Form

 

I want to be able to call that form up from the IDW using a rule as iLogic / Pure vb.net either is fine.

 

Autodesk guys, if this is not possible please let me know, I have tried lots of workarounds to try and get it to work but nothing has worked.

 

Any help is much appreciated.

 

Thanks, Matt.

 

Windows 7 | Inventor Pro 2012

0 Likes
Accepted solutions (1)
2,229 Views
1 Reply
Reply (1)
Message 2 of 2

matt_jlt
Collaborator
Collaborator
Accepted solution

Ok, found a solution (mostly due to an old post i found on the subject). I'll post it here for anyone interested.

 

In the IDW level I have a rule that gets reference to the part document from a view and executes a rule inside that that runs the form.

 

Public Sub Main()

	' Get iLogic Addin
    Dim iLogicAuto As Object = GetiLogicAddin(ThisApplication)
    If (iLogicAuto Is Nothing) Then Exit Sub
	
	' Get reference document
	Dim oRefDoc As Document = ActiveSheet.View("ViewName").ModelDocument	
	' Run rule
	iLogicAuto.RunRule(oRefDoc, "Rule - Run Form")
	
End Sub

Function GetiLogicAddin(oApplication As Inventor.Application) As Object
	' Get addin collection & addin variables
  Dim addIns As ApplicationAddIns = oApplication.ApplicationAddIns
  Dim addIn As ApplicationAddIn
  Dim customAddIn As ApplicationAddIn
  
  For Each addIn In addIns
    If (addIn.ClassIdString = "{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}") Then
    	customAddIn = addIn
    Exit For
    End If
  Next

  If (customAddIn Is Nothing) Then Exit Function
  customAddIn.Activate
  
  Return customAddIn.Automation
  
End Function

 Regards, Matt.