Hi @formobalaji. Have you attempted to create this iLogic rule code yourself yet? Have you searched within this forum to find similar questions that have already been asked before, or similar solutions that have already been posted before, as a guide to help you with this iLogic rule code?
Here is an example of an iLogic rule that can be ran while an assembly is the active document (showing on your screen). When you run this rule, it will get the file name of that assembly to a variable. Then it will create an Integer to act as suffix. Then it will iterate through every referenced document (at all levels of the assembly, not just top level), and try to update or create a custom iProperty within each of them named ""PROJECT PARTNUMBER", and try to set its value as the assembly's file name, plus a dash "-", plus that Integer, which will be incremented by 1 each time. I hope this is what you were expecting. Otherwise please include more information when you ask for help with coding challenges like this.
Sub Main
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then
MsgBox("An Assembly Document must be active for this rule to work. Exiting.", vbCritical, "")
Exit Sub
End If
Dim oADoc As AssemblyDocument = ThisDoc.Document
Dim oAllRefDocs As DocumentsEnumerator = oADoc.AllReferencedDocuments
Dim sCustomPropName As String = "PROJECT PARTNUMBER"
Dim sADocName As String = System.IO.Path.GetFileNameWithoutExtension(oADoc.FullFileName)
Dim iSuffix As Integer = 1
For Each oRefDoc As Document In oAllRefDocs
If oRefDoc.IsModifiable = False Then Continue For
Dim oCustomSet As Inventor.PropertySet = oRefDoc.PropertySets.Item(4)
Dim oCustomProp As Inventor.Property = Nothing
Dim sNextValue As String = sADocName & "-" & iSuffix.ToString
Try 'try to find already existing custom property
oCustomProp = oCustomSet.Item(sCustomPropName)
oCustomProp.Value = sNextValue
Catch 'that failed, so create the custom property
oCustomProp = oCustomSet.Add(sNextValue, sCustomPropName)
End Try
iSuffix = iSuffix + 1
Next
If oADoc.RequiresUpdate Then oADoc.Update2(True)
End Sub
Wesley Crihfield

(Not an Autodesk Employee)