what is difference between iLogicVB and InventorVB in iLogic rules?

what is difference between iLogicVB and InventorVB in iLogic rules?

liminma8458
Collaborator Collaborator
1,822 Views
7 Replies
Message 1 of 8

what is difference between iLogicVB and InventorVB in iLogic rules?

liminma8458
Collaborator
Collaborator

Hi, all,

I use iLogic occasionally. I am confused of these two namespaces in iLogic: iLogicVB and InventorVB. There are:

InventorVb.DocumentUpdate()
iLogicVb.UpdateWhenDone = True

 Are they the same? what is the difference?

There are:  iLogicVb.RunRule("ruleName"). Why not: InventorVb.RunRule("ruleName")?

So help me to find out the functional boundaries between InventorVB and iLogicVB.

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 (1)
1,823 Views
7 Replies
Replies (7)
Message 2 of 8

WCrihfield
Mentor
Mentor

As far as I've ever heard, they are both basically the same thing.  They are both predefined objects that implement/represent the same ILowLevelSupport Interface of the iLogic add-in.  Here are a couple of links on the subject.

Rule objects 

ILowLevelSupport Interface 

 

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡 or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 8

liminma8458
Collaborator
Collaborator

I don't really believe InventorVB and iLogicVB have the same functional domain. Still not understand what differentiate them. why

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 8

WCrihfield
Mentor
Mentor

Since those two objects are defined by Autodesk 'behind the scenes' within their iLogic Add-In/API, you would most likely have to consult an Autodesk software developer who works with the iLogic system directly, because there doesn't appear to be any publicly available documentation about them.  I'm thinking that if anyone would know the proper answer to this question, it might be @MjDeck (Mike Deck at Autodesk).

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 8

MjDeck
Autodesk
Autodesk
Accepted solution

iLogicVb and InventorVb are two references to the same object. The following rule demonstrates this. It uses the Visual Basic Is operator.

If iLogicVb Is InventorVb Then
	MessageBox.Show("iLogicVb and InventorVb refer to the same object.", "iLogic")
Else
	MessageBox.Show("iLogicVb and InventorVb refer to the different objects.", "iLogic")
End If


This is documented under ILowLevelSupport.

It was not a very good design decision. For clarity, it would be better to have two separate objects instead of one catch-all. The reason for two separate names : some of the properties and methods deal more or less directly with Inventor, and some of them are iLogic-specific.
For instance, InventorVb.DocumentUpdate() updates the document in which the rule is running right away. But

iLogicVb.UpdateWhenDone = True

tells iLogic to update the document *after* it has finished running the rule. That's an iLogic-specific function.
Similarly, iLogicVb.RunRule("ruleName") runs a rule. InventorVb.RunRule("ruleName") could be used and it would do the same thing. But rules are iLogic-specific, so the snippets and examples use iLogicVb for this.




Mike Deck
Software Developer
Autodesk, Inc.

Message 6 of 8

liminma8458
Collaborator
Collaborator

Great! It means the words of iLogicVB and InventorVB are interchangeable when in iLogic coding environment. For my practice, I would prefer using iLogicVB across board to deal any coding relative to iLogic.

Thanks to both of you!

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 7 of 8

charles4L34S
Contributor
Contributor

I don't like to necro old threads, but I feel the differences between iLogicVb, inventorVb and even iLogicVb.Automation really need better clarification, a good example below;

iLogicVb.RunRule only works for running rules in assembly components via the browser name (which goes against the snippet wording of compOrdocname) whereas iLogicVb.Automation.RunRule works for running rules via docname. This doesn't appear to be documented anywhere that I can find.

0 Likes
Message 8 of 8

MjDeck
Autodesk
Autodesk

Hi Charles,

iLogicVb and InventorVb are the same.
However, iLogicVb and iLogicVb.Automation are not the same.
Generally, functions that you call directly on iLogicVb do not have a Document object as an argument. They use strings (component or document names) instead.
Here's the documentation for iLogicVb.RunRule.

Functions on iLogicVb.Automation will generally take a Document object. These are meant to be more general. They can be called from an add-in or external EXE, as well as from an iLogic rule.
Here's the documentation for iLogicVb.Automation.RunRule. It doesn't accept any type of string to specify the Document. You need a Document object.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes