Hi @klemen.brezavscek. Here is an iLogic rule you can use for that task.
This rule lets you select a folder to process. It also contains an option of whether to just process the files in that folder, or to process files in all levels of sub folders too. I have it set to just process the top directory right now.
AddReference "System.IO"
Imports System.Windows.Forms
Imports System.Drawing
Imports System.IO
Dim oSFolder As String
Dim oFDialog As New FolderBrowserDialog
oFDialog.Description = "SELECT DIRECTORY TO PROCESS."
oFDialog.RootFolder = System.Environment.SpecialFolder.MyComputer
oResult = oFDialog.ShowDialog
If oResult = DialogResult.OK And
oFDialog.SelectedPath <> "" Then
oSFolder = oFDialog.SelectedPath
Else
Exit Sub
End If
'MsgBox(oSFolder)
oFiles = System.IO.Directory.EnumerateFiles(oSFolder, "*.*", System.IO.SearchOption.TopDirectoryOnly).Where(Function(s) _
s.ToLower.EndsWith(".ipt") Or s.ToLower.EndsWith(".iam"))
For Each oFile In oFiles
' MsgBox("oFile = " & oFile,,"")
Dim oDoc As Document = Nothing
oDoc = ThisApplication.Documents.Open(oFile, False)
iLogicVb.Automation.DeleteAllRulesInDocument(oDoc)
oDoc.Save2(False)
oDoc.ReleaseReference
Next
ThisApplication.Documents.CloseAll(True) 'True = unreferenced documents only
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡 or you can Explore My CONTRIBUTIONS
Wesley Crihfield

(Not an Autodesk Employee)