Hi @amarinXG8V6. If you want to replace file name with project iProperty value, we can do that fairly easily too. I would leave the line in place that gets the document object, because we can still use that to get the iProperty within that document.
Just replace this line:
oFileName = System.IO.Path.GetFileNameWithoutExtension(oPartDoc.FullFileName)
with this line:
Dim oProject As String = oPartDoc.PropertySets.Item("Design Tracking Properties").Item("Project").Value
Then change this line:
oParamValue = oFileName & "-" & oItemNum
to something like this:
oParamValue = oProject & "-" & oItemNum
Beware though...you may want to check to see if the Project iProperty has been filled in or not, just in case it is empty. I don't know if that would cause any problems if it were empty. To do so, you could just check if oProject = "". Then if it is empty, you could show yourself a message or use the iLogic Logger to write something to the log. Also beware of any 'virtual' components you may have in your BOM (if any), because they may not have a Document, which might cause an error.
Wesley Crihfield

(Not an Autodesk Employee)