Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

what is difference between iLogicVB and InventorVB in iLogic rules?

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
liminma8458
981 Views, 7 Replies

what is difference between iLogicVB and InventorVB in iLogic rules?

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 2.1; Windows 10 pro 64 bit version 21H2; Office 2013 32 bit
7 REPLIES 7
Message 2 of 8
WCrihfield
in reply to: liminma8458

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 :light_bulb: or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 8
liminma8458
in reply to: WCrihfield

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 2.1; Windows 10 pro 64 bit version 21H2; Office 2013 32 bit
Message 4 of 8
WCrihfield
in reply to: liminma8458

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)

Message 5 of 8
MjDeck
in reply to: liminma8458

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
in reply to: MjDeck

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 2.1; Windows 10 pro 64 bit version 21H2; Office 2013 32 bit
Message 7 of 8
charles4L34S
in reply to: MjDeck

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.

Message 8 of 8
MjDeck
in reply to: charles4L34S

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report