Inventor Customization

Reply
Mentor
matt_jlt
Posts: 218
Registered: ‎07-28-2007
Message 1 of 2 (630 Views)
Accepted Solution

Call iLogic Form Via API

630 Views, 1 Replies
02-06-2013 02:28 PM

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

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.

Mentor
matt_jlt
Posts: 218
Registered: ‎07-28-2007
Message 2 of 2 (620 Views)

Re: Call iLogic Form Via API

02-06-2013 05:51 PM in reply to: matt_jlt

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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!