Suppress and unsuppress certain rules base on the choices

Suppress and unsuppress certain rules base on the choices

Ahmed.shawkyXTZHN
Enthusiast Enthusiast
567 Views
7 Replies
Message 1 of 8

Suppress and unsuppress certain rules base on the choices

Ahmed.shawkyXTZHN
Enthusiast
Enthusiast

hello everyone , I'm Looking for rule that can suppress and un-suppress certain rules or user parameters I got one rule but it suppress only or it's not working properly with me so I need your help and guidance , thanks.

 

"auto = iLogicVb.Automationauto.GetRule(ThisDoc.Document, "DOUBLE_DOOR").IsActive = False
If (Not DOUBLE_DOOR_Enabled) Then Return"

0 Likes
Accepted solutions (2)
568 Views
7 Replies
Replies (7)
Message 2 of 8

Andrii_Humeniuk
Advisor
Advisor

Hi @Ahmed.shawkyXTZHN . This rule suppress another rule:

 iLogicVb.Automation.GetRule(ThisDoc.Document, "DOUBLE_DOOR").IsActive = False

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 3 of 8

Ahmed.shawkyXTZHN
Enthusiast
Enthusiast

thanks for your response , yes this similar to what I wrote  but how to unsuppress the rule if the selection changed.

0 Likes
Message 4 of 8

Andrii_Humeniuk
Advisor
Advisor

Unsuppress your rule:

 iLogicVb.Automation.GetRule(ThisDoc.Document, "DOUBLE_DOOR").IsActive = True

 I just don't understand how you want to suppress the user parameters. As far as I know such functions do not exist, parameters can be created or deleted.

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 5 of 8

Ahmed.shawkyXTZHN
Enthusiast
Enthusiast

 I need both in one rule if valid it will suppress if not will unsuppress , I want to suppress another rule not parameter , may this not the best way to eliminate the effect of a rule .

0 Likes
Message 6 of 8

Andrii_Humeniuk
Advisor
Advisor
Accepted solution

Here is the logic for determining the suppression of a rule:

Dim iRule As iLogicRule = iLogicVb.Automation.GetRule(ThisDoc.Document, "DOUBLE_DOOR")
If iRule.IsActive Then ' Rule is unsuppress
	iRule.IsActive = False
Else ' Rule is suppress
	iRule.IsActive = True
End If

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

0 Likes
Message 7 of 8

WCrihfield
Mentor
Mentor
Accepted solution

Judging by your first post, I'm guessing you might want it formatted this way:

Dim oDoc As Document = ThisDoc.Document
Dim oRule As iLogicRule = iLogicVb.Automation.GetRule(oDoc, "DOUBLE_DOOR")
If oRule Is Nothing Then Exit Sub
If DOUBLE_DOOR_Enabled Then
	oRule.IsActive = True
Else
	oRule.IsActive = False
End If

...or the other way around.  It's difficult to tell exactly how you need this rule to be laid out.  Do you just need to stop this rule from automatically running when the value of the parameter named "DOUBLE_DOOR_Enabled" is changed, or do you want the value of that parameter to dictate whether the rule is suppressed/unsuppressed...or is that still not correct?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 8 of 8

Ahmed.shawkyXTZHN
Enthusiast
Enthusiast
thanks
0 Likes