Shared Variables

Shared Variables

Anonymous
Not applicable
1,777 Views
7 Replies
Message 1 of 8

Shared Variables

Anonymous
Not applicable

Where can I access a list of all shared variables?

 

If they are stored in memory, is that memory cleared when Inventor is closed?

 

What is the Free iLogic Memory command mentioned on Autodesk help page below and how is that different to the RemoveAll command.

 

SharedVariable.RemoveAll()

Removes all shared variables. Use this function with care in a rule. If any unrelated parts and assemblies are open that use shared variables, use the Free iLogic Memory command instead.

0 Likes
1,778 Views
7 Replies
Replies (7)
Message 2 of 8

bradeneuropeArthur
Mentor
Mentor
What would you like to achieve?
About the shared variables I mean.

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

Anonymous
Not applicable

They are working fine for me. I'm just curious how they work really.... and was concerned about that comment on the autodesk help page

0 Likes
Message 4 of 8

ReneRepina
Collaborator
Collaborator

Bumping post. I am also wondering how they work and did not find answer yet.

 

@bradeneuropeArthur

Any good answers about this?

0 Likes
Message 5 of 8

WCrihfield
Mentor
Mentor

I believe this is the 'command' they are referring to:

"iLogic.FreeILogicMemory"

ThisApplication.CommandManager.ControlDefinitions.Item("iLogic.FreeILogicMemory").Execute

Inventor's online help, although useful for some things, is pretty much famous for referring to other things, then not supplying any links or further instructions to find out more about what they are referring to.

 

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 have time, please... Vote For My IDEAS 💡or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 6 of 8

ReneRepina
Collaborator
Collaborator

@WCrihfield 

Thanks for the reply. Do you maybe know the answer about other questions on this thread?

0 Likes
Message 7 of 8

WCrihfield
Mentor
Mentor

Yes.  When you close Inventor, any SharedVariables will be lost.  They aren't stored in general system memory, they are stored in 'session memory'.  Session memory is dumped (lost) when the Inventor 'session' ends (when you close Inventor).  SharedVariables can be very handy for sharing data between different rules (both local & external), and don't require you to dirty your document by creating new parameters, iProperties, or attributes (all of which are saved in the document).  You can set up some rules to receive 'input' data for use in their main Sub or Function this way, then can also receive 'input' data back from those other rules/macros that way.  But they aren't the only way to send/receive (share) data between rules.

Here is a link to it's Interface page in Inventor's online help:  ISharedVariable Interface

It is defined within the iLogic Add-in's Interfaces dll. ("Autodesk.iLogic.Interfaces.dll"), so it's not naturally available in the VBA editor.

You can also use RuleArguments and NameValueMaps to share data between them.  You'll notice that the 'Arguments' property of RuleArguments is a NameValueMap also.  These two can also be used between iLogic rules and VBA macros.  You would of course, use the RuleArguments on the iLogic side, if communicating between a rule and a macro, because it too is defined within the iLogic add-in, but NameValueMaps are recognized in both iLogic and VBA.

Here is a link to one of my contribution posts, where I show how to use those two interfaces to send and receive data between two rules, that you might find helpful.

 

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

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 8 of 8

ReneRepina
Collaborator
Collaborator

 @WCrihfield 

Thanks for the explanation!

0 Likes