How to call iLogic function from VB.NET addin?

How to call iLogic function from VB.NET addin?

liminma8458
Collaborator Collaborator
2,594 Views
13 Replies
Message 1 of 14

How to call iLogic function from VB.NET addin?

liminma8458
Collaborator
Collaborator

Hi, to who can help,

 

In iLogic, there are a lot of wonderful functions which can be used, such as: ht=GoExcel.CellValue("tank_data.xls", "General", "in_tank_ht") . I wonder whether this GoExcel.CellValue function can be used directly from VB.NET addin. If yes, how?

 

In my trial, I added "Autodesk.iLogic.Interfaces.dll" into references of my vb.net project. We can notice there is "Autodesk.iLogic.Interfaces.IGoExcel.CellValue(...) in Object Browser, as shown in screen shot of attached file. Then I created a VB.NET snippet to test (also attached in the file), but it fails.

 

So, does anyone know how to call this kind of iLogic functions from VB.NET addin?  It will save a lot of time to create the same function in VB.NET again.

 

Thank you very much!

 

 

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Accepted solutions (3)
2,595 Views
13 Replies
Replies (13)
Message 2 of 14

Vladimir.Ananyev
Alumni
Alumni

Hope the following links would be useful:

Run iLogic rule from external application

http://adndevblog.typepad.com/manufacturing/2013/09/run-ilogic-rule-from-external-application.html
 

Call iLogic from .NET

http://adndevblog.typepad.com/manufacturing/2013/04/call-ilogic-from-net.html
 

Call iLogic rule from add-in

http://forums.autodesk.com/t5/inventor-customization/call-ilogic-rule-from-add-in/td-p/3075414

cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 14

liminma8458
Collaborator
Collaborator

Vladimir,
 
Thank you so much for your information.
 
Actually, I can call iLogic "Rule" without any problem, as described in your attached links. What I ask is whether I can directly call or utilize the functions that the iLogic rule is using such as GoExcel.CellValue(....) in VB.NET Addin? and how?
 
As my attached file in this mail, this GoExcel.CellValue(....) function is in Autodesk.iLogic.Interfaces.IGoExcel as shown in Object Browser in VB.NET. They are not in the same Interface as IiLogicAutomation. So do these functions in Autodesk.iLogic.Interfaces.IGoExcel can be called directly from Addin? or It is not exposed for Addin usage yet.
 
Thanks
 
Limin

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Message 4 of 14

awatt
Advocate
Advocate

 

I'd like to see a response to this too.  I'm trying to accomplish the same thing.  My efforts took me into ADO land, and didn't get me any farther.  I tend to blame my unfamiliarity with interface classes.

 

Any help anyone can offer would be, um, helpful?

 

0 Likes
Message 5 of 14

MechMachineMan
Advisor
Advisor
From following in the 2nd link, it looks like interfaces is the wrong addin to use. Is there a Autodesk.iLogic.Automation. path that exsists that you can work with?

I know I've done some things with iLogic and it always invloved .Automation or something similiar

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 6 of 14

awatt
Advocate
Advocate

Ok, I found the GoExcel definition in the {iLogic} namespace in the autodesk.ilogic.core dll.

Trying to create one, I discovered it needs three parameters to use the NEW keyword.

It needs the Inventor Document, the Inventor server object, and an excel cache object.

 

So at the moment, I'm fuzzy on what exactly the inventor server object is, and what the excel cache object is, and how to use it.

 

0 Likes
Message 7 of 14

MechMachineMan
Advisor
Advisor
There should be a autodesk.ilogic.automation though, not?

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 8 of 14

awatt
Advocate
Advocate

Haven't needed the Automation functions yet.  I'm not trying to access or manipulate rules.  I'm trying to work exclusively in vb.net, but hijacking the functionality of the GoExcel function.

 

I've found the InventorServerObject as a property of Autodesk.iLogic.Core.iLogicCentral object.

 

 

0 Likes
Message 9 of 14

awatt
Advocate
Advocate

So here's what I've been doing the last couple of hours:

I know that InventorServerObject is needed to create a new GoExcel object. But where to get one?

The Autodesk.iLogic.Core.iLogicCentral object has the InventorServer object as one of its properties.

But how to use this object?  I don't know.

While trying to find out, I found that InventorServerObject is also a property of the Autodesk.iLogic.Interfaces.ILowLevelSupport object.

But where do I get an object that can use this interface?

Ah, the Autodesk.iLogic.Interfaces.IRulesHost has a GetLowLevelSupport function.

But where do I get an object that can use the IRules Host interface?

<Dead End>

 

What I could really use now is a few more hoops to jump through.*Sarcasm* *Sigh*

0 Likes
Message 10 of 14

liminma8458
Collaborator
Collaborator

Hi, everyone,

 

There is no solution for my question as in post 1 and 3 yet.

 

I hope someone can send some code snippet if you can call iLogic functions (no the rule) FROM VB.NET, such as GoExcel.CellValue(....) .

 

Thanks
 
Limin

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Message 11 of 14

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

I've written a blog post about this based on the information I got from engineering:

http://adndevblog.typepad.com/manufacturing/2015/05/use-goexcel-outside-a-rule.html

 

Cheers,



Adam Nagy
Autodesk Platform Services
Message 12 of 14

awatt
Advocate
Advocate
Accepted solution

Good stuff.  Thanks.

In my application, I finally decided to use the excel interop.  I was trying to avoid creating a running excel process, even a background one.  But then I wondered if perhaps that's what goexcel was doing anyway.

 

Message 13 of 14

adam.nagy
Autodesk Support
Autodesk Support
Accepted solution

Yes, that's what iLogic is using too. Have updated the blog post to point this out.



Adam Nagy
Autodesk Platform Services
Message 14 of 14

liminma8458
Collaborator
Collaborator

Thank all of you! terrific!

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes