Hello,
I have a query regarding suppressing/unsuppressing ilogic rules.
Let us say, I had created 4 ilogic rules [Rule1, Rule2, Rule3, Rule4]
I had created two LOD's.
One LOD works on Rule 1 and Rule 2
Another LOD works on Rule 3 and Rule 4
Now I have to write a i-Logic in such a way that, if i select First LOD, it has to suppress Rule 3 and Rule 4
Again, if i Select Second LOD, it has to suppress Rule 1 and Rule 2.
Please help me how to do the same.
Solved! Go to Solution.
Solved by rossano_praderi. Go to Solution.
Hello Mahesh,
with the follow Ilogic code you can suppress/unsuppress the rules.
Try ActiveLOD = ThisDoc.Document.ComponentDefinition.RepresentationsManager.activeLevelofDetailRepresentation.Name Auto = iLogicVb.Automation Select Case ActiveLOD Case "LOD1" Auto.GetRule(ThisDoc.Document, "Regola0").IsActive = False Auto.GetRule(ThisDoc.Document, "Regola1").IsActive = False Auto.GetRule(ThisDoc.Document, "Regola2").IsActive = True Auto.GetRule(ThisDoc.Document, "Regola3").IsActive = True Case "LOD2" Auto.GetRule(ThisDoc.Document, "Regola0").IsActive = True Auto.GetRule(ThisDoc.Document, "Regola1").IsActive = True Auto.GetRule(ThisDoc.Document, "Regola2").IsActive = False Auto.GetRule(ThisDoc.Document, "Regola3").IsActive = False End Select Catch ex As exception End Try
There is'nt Inventor triggers that react on LOD change.
With ilogics you can write a rule for catching events but, if you don't have a good knowledge on how to do it, you will make Inventor unstable.
The right solution for catching events is to write an addin with Visual Studio.
This is an example on how to make addins with events catching - LINK.