Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Curtis_Waguespack
in reply to: rfink

Hi rfink,

 

Assuming the rule with the error is an internal rule and not an External rule, I think you can use something like this to suppress a rule of given name, as you edit the document. Make sure to use ActiveEditDocument (rather than ActiveDoucment).

 

 

Auto = iLogicVb.Automation
Dim iLogicAuto As Object
iLogicAuto = Auto
Dim oDoc As Document
oDoc = ThisApplication.ActiveEditDocument

'get collection of rules
Dim ruleName As String
Dim rules As Object
rules = iLogicAuto.rules(oDoc)

'make sure there are rules in the file
If Not (rules Is Nothing) Then
	For Each rule In rules
	If rule.Name = "MyRule" Then
		'suppress rule
		iLogicAuto.GetRule(oDoc, rule.Name).IsActive = False 
	End If
	Next 
Else
End If

 

 

Or use this to delete the rule:

 

Auto = iLogicVb.Automation
Dim iLogicAuto As Object
iLogicAuto = Auto
Dim oDoc As Document
oDoc = ThisApplication.ActiveEditDocument

'get collection of rules
Dim ruleName As String
Dim rules As Object
rules = iLogicAuto.rules(oDoc)

'make sure there are rules in the file
If Not (rules Is Nothing) Then
	For Each rule In rules
	If rule.Name = "MyRule" Then
		'delete rule
		iLogicAuto.DeleteRule(oDoc, rule.Name)
		
	End If
	Next 
Else
End If

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com