iLogic rule for deleting or replacing files in a folder

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
Is there a iLogic rule to Opne, Save (as stp and PDF) , delete olde versions, and close the file. I whant to start the rule from a assembly file, and i have 3 parts to be saved as stp and PDF. I have this rule, but with this i open, save, and close the part. The old parts are in the folder. (this rule save the parts as "Position X" , where X is a parameter from excel)
When i save ther rule as "Positon 3" Position 2 shuld be deleted.
So, i need to have 3 PDF and 3 STEPS from the current position
Here is a rule that save as STP (Position = parameter from excel)
'get the part
part = Component.InventorComponent("Glashalter mittig:1")
'open the part
doc = ThisApplication.Documents.Open(part.Definition.Document.FullDocumentName)
'oPath = ThisDoc.Path & "\"
' save the part as step
' doc.SaveAs(oPath & "Glashalter mitte position_" & Position & ".stp" , True)
stp1=doc.SaveAs("C:\Users\Aleksandar.Jovicic\Desktop\FGL\Fertigung\Glashalter\Glashalter mitte " & Position $".stp" , True)
' close the part
doc.Close()