Run iLogic rule from an external part file.

Run iLogic rule from an external part file.

meck
Collaborator Collaborator
3,954 Views
2 Replies
Message 1 of 3

Run iLogic rule from an external part file.

meck
Collaborator
Collaborator

I have a solid body part file that holds data for all the parts derived from it. I want to run a rule in one of the derived part files from the solid body part. Is this possible? I did a search for this but couldn't find anything.

 

Thanks in advance!

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
0 Likes
Accepted solutions (1)
3,955 Views
2 Replies
Replies (2)
Message 2 of 3

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi meck,

 

I think something like this should work for you.

 

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

 

 

'''Run ilogic rule in file

'define path and name
Dim sFilePath As String 
sFilePath = "C:\TEMP\777.ipt" 

'name of ilogic rule
Dim oRuleName As String = "TestRule" 

'open the file invisibly
oFile =  ThisApplication.Documents.Open(sFilePath, False) 

'define the ilogicAutomation
Dim iLogicAuto As Object 
iLogicAuto = iLogicVb.Automation 

'get the rule
Dim oRule As Object 
oRule = iLogicAuto.GetRule(oFile, oRuleName) 

'run the rule
iLogicAuto.RunRuleDirect(oRule) 

'close the file
oFile.Close 

EESignature

Message 3 of 3

Anonymous
Not applicable

do you have a code for the File location? 

that the file location is always the location of the file that u use?

0 Likes