Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I-Logic Suppress rule

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
MaheshwarMD
386 Views, 2 Replies

I-Logic Suppress rule

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.

 

Mahesh
2 REPLIES 2
Message 2 of 3

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.

 

 

 



--------------------------------------
If my post answers your question, please click the "Accept as Solution"
button. This helps everyone find answers more quickly!
---------------
Message 3 of 3

Hello,

 

Thanks a lot

Mahesh

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report