This iLogic rule will create the other iLogic rule, without automatically running the new one when its made.
Dim oRuleName As String = ""
Dim oRuleText As String
oRuleText = ""
Dim oDoc As Document = ThisApplication.ActiveEditDocument
Dim oRuleExists As Boolean = False
'Define iLogic AddIn
Dim oiLogicAddin As ApplicationAddIn ' = ThisApplication.ApplicationAddIns.Item("iLogic")
For Each oAppAddin As ApplicationAddIn In ThisApplication.ApplicationAddIns
If oAppAddin.DisplayName = "iLogic" Then
oiLogicAddin = oAppAddin
End If
Next
Dim iLogicAuto = iLogicVb.Automation
Dim oRules As ObjectCollection
oRules = iLogicAuto.Rules(oDoc)
If oRules.Count > 0 Then
For Each oRule As Object In oRules
If oRule.Name = oRuleName Then
oRuleExists = True
End If
Next
End If
If oRuleExists = True Then
Dim oReplaceRule As MsgBoxResult
oReplaceRule = MsgBox("A Rule called '" & oRuleName & " already exists." & vbNewLine &
"Do you want to replace it?", MsgBoxStyle.Question, "RULE EXISTS")
If oReplaceRule = vbYes Then
iLogicAuto.DeleteRule(oDoc, oRuleName)
iLogicAuto.AddRule(oDoc, oRuleName, "")
Else
MessageBox.Show("Nothing was ", "")
End If
End If
'iLogic.AddRule(oDoc, RuleName, "")
'iLogicVb.Automation.GetRule(ThisDoc.Document, RuleName).Text = RuleText
Wesley Crihfield

(Not an Autodesk Employee)