Looking Rule to delete all Rules in ipt

Looking Rule to delete all Rules in ipt

Anonymous
Not applicable
941 Views
7 Replies
Message 1 of 8

Looking Rule to delete all Rules in ipt

Anonymous
Not applicable

Hi all,

 

I am looking for help for the below requirement

 

I have few Inventor parts, using 'SaveCopyAs' command I am creating copy of all these files and saving it in separate folder.

I am looking for Rule that deletes all the Rules in the newly created Inventor part file (.ipt) 

 

Any help will be greatly appreciated

 

Thanks

Rudresh

0 Likes
Accepted solutions (1)
942 Views
7 Replies
Replies (7)
Message 2 of 8

LukeDavenport
Collaborator
Collaborator
Accepted solution
Hi Rudresh,
You can do this manually with the below command
[image: Inline image 1]
Alternatively, here is a blog I wrote with an iLogic rule to delete all
rules in the active part (or assembly)

https://www.cadlinecommunity.co.uk/hc/en-us/articles/202020531-Inventor-2015-iLogic-Delete-All-iLogi...

Best regards,
Luke
Message 3 of 8

LukeDavenport
Collaborator
Collaborator

 

Sorry this was the command I was referring to.

 

Picture1.png

0 Likes
Message 4 of 8

Anonymous
Not applicable

Thanks Luke,

 

I used the Logic that you have refferred, had to change some lines. It worked fine..

 

Thanks

Rudresh

0 Likes
Message 5 of 8

b.mccarthy
Collaborator
Collaborator

Hello.

 

I also have need of this process, however, the link above is no longer valid (only 10+ years old. What's up with that???)

 

Can anyone who has this code, or similar, share it, please?

 

TIA

0 Likes
Message 6 of 8

jnowel
Advocate
Advocate
0 Likes
Message 7 of 8

b.mccarthy
Collaborator
Collaborator

@jnowel 

 

Thank you, however, that rule appears to delete all rules in all components in an assembly, which is not what I need. I am looking to delete all rules at the part level.

 

I am sure that the @Andrii_Humeniuk code could be modified to run at the part level, but that is beyond my current skill level.

 

TIA

0 Likes
Message 8 of 8

jnowel
Advocate
Advocate

@b.mccarthy 

 

Below line of code can do that and will only delete the rules on the ActiveDocument (it may be a part, assembly or drawing)
This will have to be ran as an external rule.

iLogicVb.Automation.DeleteAllRulesInDocument(ThisApplication.ActiveDocument)

Above line can be modified to only delete the rules if the ActiveDocument is a Part (and won't delete rules if it is a drawing or assembly)

Dim oDoc As Document = ThisApplication.ActiveDocument
If TypeOf oDoc Is PartDocument Then iLogicVb.Automation.DeleteAllRulesInDocument(oDoc)

jnowel_1-1762841160184.png

 

0 Likes