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: 

ilogicVb. Runrule

1 REPLY 1
Reply
Message 1 of 2
karram
152 Views, 1 Reply

ilogicVb. Runrule

Hello,

 

Currently, I have a main assembly with 50 parts. Each part contains a suppression rule. In the main assembly, I used the below iLogic rules to process all 50 parts, which takes more time. Are there any alternative ilogic rules available to speed up the process, such as a common rule? For Example, when I update my main rule to change a user parameter, is there a way to automatically activate all corresponding suppression rules for all parts?"

 

Current code like below in my main assembly

iLogicVb.RunRule("Part1:1", "Supp")
iLogicVb.RunRule("Part2:1", "Supp")
iLogicVb.RunRule("Part3:1", "Supp")
...
...
...
iLogicVb.RunRule("Part50:1", "Supp")

1 REPLY 1
Message 2 of 2
Curtis_Waguespack
in reply to: karram

Hi @karram 

 

What does the code in the part files do?

 

Most likely you can move that code up to an assembly rule and run it on each occurrence, and eliminate the need to run rules down at the part level.

 

For example if the rule were suppressing a hole in the parts, you could have something like this at the assembly level to do the same thing

 

Dim oDoc As AssemblyDocument = ThisDoc.Document
For Each oOcc In oDoc.ComponentDefinition.Occurrences
	Try
		Feature.IsActive(oOcc.name, "Hole2") = False
	Catch ex As Exception
		Logger.Error(ex.Message)
	End Try
Next

 

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

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

Post to forums  

Autodesk Design & Make Report