Can I forbid running ilogic rules?

Can I forbid running ilogic rules?

wmgshurik
Enthusiast Enthusiast
369 Views
2 Replies
Message 1 of 3

Can I forbid running ilogic rules?

wmgshurik
Enthusiast
Enthusiast

Can I forbid running ilogic rules when my API plugin has been started? 

Can I debug ilogic code from Visual Studio? Sometimes VS shows me that code when ilogic cathes exception, but I dont know how I can reach it by myself.

0 Likes
Accepted solutions (1)
370 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor
Accepted solution

Can I forbid running ilogic rules when my API plugin has been started? 


As far as i know, you have 2 options: Deactivate the iLogic adding when your plugin starts. Or you can use the "IiLogicAutomation.EnterDelayedRuleRunningMode". This puts iLogic into a delayed rule-running mode. In this mode, rules that are triggered by parameter changes and other events will not be run until you call ExitDelayedRuleRunningMode.

 


Can I debug ilogic code from Visual Studio? Sometimes VS shows me that code when ilogic cathes exception, but I dont know how I can reach it by myself.


Also here there are 2 options. Have a look at this page. It explains how you can setup VS to debug your rules that are written in Inventor.

The 2e option is one of my own makings. You can get this VS project and you can write/debug iLogic rules in Visual studio. I prefer writing iLogic rules in VS but there are 2 disadvantages. not all iLogic features/api is available. When you finished writing your rule you still need to copy it to Inventor.

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3

wmgshurik
Enthusiast
Enthusiast

Yep! I didn't know I could deactivate any addin. Thank you very much for the right direction of thought 😃

https://adndevblog.typepad.com/manufacturing/2013/09/run-ilogic-rule-from-external-application.html - That's the article by Adam Nagy.

To be short, it is enough for my goals:

 

Inventor.ApplicationAddIn addin = null;
string iLogicAddinGuid = "{3BDD8D79-2179-4B11-8A5A-257B1C0263AC}";
try
{
addin = InvApp.ApplicationAddIns.get_ItemById(iLogicAddinGuid);
}
catch
{
}
if (addin != null)

{
if (addin.Activated)
addin.Deactivate();
}

 

///

/// MY CODE

///

 

if (addin != null)
{
if (!addin.Activated)
addin.Activate();
}

0 Likes