Hi @BRLMCHKD,
I didn't read all the other replies, but based on your information stating that Detail Dwg number needs to come from the part number of the occurrences I would use something like this:
' Get the active document. This assumes it Is a part document.
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences.AllReferencedOccurrences(oAsmCompDef)
oPartNumber = iProperties.Value(oOccurrence.Name, "Project", "Part Number")
'find the postion Of the last ) In the name
oPos = InStrRev(oPartNumber, ")",-1)
'Get middle 10 chars of the part number starting at
'position Of ), +1
oPN = Mid(oPartNumber,oPos+1,10 )
iProperties.Value(oOccurrence.Name, "Custom", "Detail Dwg") = oPN
Next
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com