Simple VB.NET code (call a service with iLogic)

Simple VB.NET code (call a service with iLogic)

Maxim-CADman77
Advisor Advisor
1,346 Views
8 Replies
Message 1 of 9

Simple VB.NET code (call a service with iLogic)

Maxim-CADman77
Advisor
Advisor

Advanced iLogic Techniques Reference begins with the statement "You can write iLogic rules using only Inventor parameter assignment statements, predefined iLogic functions, and simple VB.NET code."

I' d like to know what is the meaning of that "simple VB.NET code."

 

We used to use the intermediate DLL to interconnect Inventor with our ERP svc (service) but this seems a bit too complex thus we'd rather prefer to have a direct calls to it from the iLogic. If it possible or it is something beyond the "simple VB.NET"?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
1,347 Views
8 Replies
Replies (8)
Message 2 of 9

bradeneuropeArthur
Mentor
Mentor

Hi,

 

If you already start programming "Complex Vb.net Code or Not simple Vb.net code" you better start programming everything in Vb.net and forget about illogic.

This will have many benefits and is much easier to program.

if you need help, please let me know.

As actually already have said using illogic for this will be a bridge to far.

It will be possible in some kind of way but this is (To my opinion) nothing for illogic.

I logic was never build for this kind of projects.

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 3 of 9

Maxim-CADman77
Advisor
Advisor
Almost always the first answer to my questions in this forum is NO (which indeed is not very valuable, hope not to offend you).

Yet I'd like to know some positive vision regarding the question (now two developers are involved in iLogic-based project but I want to free the man who supports the DLL to some other works letting the iLogic-man to work on its own).

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 4 of 9

bradeneuropeArthur
Mentor
Mentor

The answer was definitely not a NO answer. 

But to my understanding I logic was never build for these complex programming, and will not be easy.

The easier methods like Vb.net are a better choice.

The user is free to choose of course!

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 9

YuhanZhang
Autodesk
Autodesk

If you read to below paragraph in your referenced link:

 

When you develop advanced VB.NET code, use Visual Studio or Visual Basic Express rather than coding directly in a rule. You can then cut and paste relatively small snippets of code from Visual Studio into a rule. You can even paste in an entire dialog box Class (although resources are not easily supported). For larger units of code, or where required, create an assembly and use it as an external DLL from a rule. 

You may understand that iLogic supports you to copy-paste simple VB.net code to iLogic rule to run, but for some complex VB.net code may not be run well if you just copy-paste to iLogic rule. So you can create a DLL using your Visual Studio, and reference it in iLogic. As you said you have a DLL to interconnect Inventor with your ERP service, then you can try to reference it in your iLogic rule and check if you can call it successfully.

 

Hope this clears.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 6 of 9

connor.ferguson
Advocate
Advocate

I have written code in iLogic directly to integrate with other systems and never had any issues. If it can run the .dll it will run the same code in the iLogic rule. You just need make sure all reference paths to needed .dlls are declared at the top of the rule or are in the Inventor.exe folder.

I.e. if you are integrating with a cloud system and making ReST Api calls then you might need the Newtonsoft.Json.dll.

So this would either need to be in the Inventor.exe folder and imported at the top of the rule, or you can add a reference to the .dll file location using AddReference "C:\Newtonsoft.Json.dll"

 

The only reason i'd tend to write the code in Visual Studio first before copying and pasting to an iLogic rule is the iLogic IDE is obviously not as good as Visual studios with the formatting , intellisense etc.

 

0 Likes
Message 7 of 9

Maxim-CADman77
Advisor
Advisor

Sorry for the year-delay (had no time to dive deeper into the question until a globe pandemia 🙂 ).

 

I still don't uderstand whether referencing to self-made DLL from iLogic provides some principal benefits comparing to calling same functions/methods from iLogic itself (no matter same or another external rule)?

Please vote for Inventor-Idea Text Search within Option Names

0 Likes
Message 8 of 9

connor.ferguson
Advocate
Advocate
There's no advantage or disadvantage. You can write the code straight in the iLogic rule if you like. Adding a reference to separate dll is handy if you already have the code packaged in a dll or if the system you are with provides dll's to use as part of its SDK.
0 Likes
Message 9 of 9

Maxim-CADman77
Advisor
Advisor

I do use DLL but I'd rather prefer to have it open code (as another iLogic) but i still don't understand if it possible for sure (author of DLL believes that it is impossible).

Please vote for Inventor-Idea Text Search within Option Names

0 Likes