Change iLogic rule options via vb.net?

Change iLogic rule options via vb.net?

Anonymous
Not applicable
481 Views
3 Replies
Message 1 of 4

Change iLogic rule options via vb.net?

Anonymous
Not applicable

Hi everyone,

 

a short question.

 

I want to generate an internal iLogic rule via vb.net.

 

That is no big Problem.

 

But I also want to change the setting in the rule options "don't run automatically"

 

Manually it is no Problem, but is it possible by creating the rule via .net?

 

Greetings

0 Likes
482 Views
3 Replies
Replies (3)
Message 2 of 4

xiaodong_liang
Autodesk Support
Autodesk Support

 Hi,

with my experience, I think it should work by calling iLogicRule.AutomaticOnParamChange = false. This blog tells how to access iLogicRule.
http://adndevblog.typepad.com/manufacturing/2013/04/call-ilogic-from-net.html

 

However, when I tested it today, addin.Automation failed to be casted to iLogicAutomation. I am checking that the issue is.

 

 

0 Likes
Message 3 of 4

Anonymous
Not applicable

Hi,

 

first, thanks for your reply.

 

I tried it:

 

(The iLogicAuto is the iLogicAddin)

 

                
iLogicAuto.AddRule(oDoc, RuleName, RuleText) For Each Element In iLogicAuto.Rules(oDoc) If Element.Name = RuleName Then Element.AutomaticOnParamChange = False
'Element.AutomaticOnParamChange = True Exit For End If Next

 

 

The rule is created and everything is fine, except the Options. It makes no difference, which value you use, True or False, both the same = False

 

Options.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

So, maybe I did something wrong?

 

Greetings

 

Passi

0 Likes
Message 4 of 4

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

I have not made my code VB.NET code work. However, our expert of iLogic confirmed it is true iLogicRule.AutomaticOnParamChange can toggle the option on/off. The attachment is a sample, but in iLogic, instead of VB.NET. 

 

To test: change the Rule0_Trigger parameter. Then change it again. Each change will toggle the AutomaticOnParamChange flag for the rule named OtherRule. As a result, OtherRule will only run on every other run of Rule0.

 

the expert also said: 

Maybe you are toggling the rule property too late? If you disable the rule after it was already triggered to run, then the disabling won’t prevent it from running that one time. But it should still disable future automatic runs.

0 Likes