Missing Reference STEP

Missing Reference STEP

m.schrepfer
Advocate Advocate
1,049 Views
7 Replies
Message 1 of 8

Missing Reference STEP

m.schrepfer
Advocate
Advocate

Hello,

 

I´v an error by opening an assembly with missing reference.

I´ve made an copy of the assembly, deleted all components and the error continues to occur.

I´ve found no referenced document or referenced files but an entry under File/ReferencedFileDescriptor/Item1/...

Is there a possibility to delete this reference?

Markus Schrepfer
0 Likes
Accepted solutions (1)
1,050 Views
7 Replies
Replies (7)
Message 2 of 8

A.Acheson
Mentor
Mentor

Maybe try this link, there  is a VBA version in there. Maybe ensure to copy file before deleting the occurrence. 

https://forums.autodesk.com/t5/inventor-customization/ilogic-check-for-and-delete-all-unresolved-com...

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 3 of 8

m.schrepfer
Advocate
Advocate

Hi @A.Acheson 

Thanks for your tipp.

But this don´t work

If oFileDescriptor.ReferencedDocument = nothing then
   delete oFileDescriptor
End If

 And the other code only deletes Occurences but I don´t have this missing file in the occurences.

Private Sub ProcessReferences(ByVal oFile As Inventor.File, oDoc As AssemblyDocument, oDocDef As ComponentDefinition)

        Dim oFileDescriptor As FileDescriptor
        For Each oFileDescriptor In oFile.ReferencedFileDescriptors
            If Not oFileDescriptor.ReferenceMissing Then
                If Not oFileDescriptor.ReferencedFileType = FileTypeEnum.kForeignFileType Then
                    Call ProcessReferences(oFileDescriptor.ReferencedFile, oDoc, oDocDef)
                End If
            Else
            Dim oComp As ComponentOccurrence
            For Each oComp In oDocDef.Occurrences
            If oComp.ReferencedDocumentDescriptor.ReferencedFileDescriptor.FullFileName = oFileDescriptor.FullFileName Then
            MsgBox (oFileDescriptor.FullFileName & vbCrLf & oFileDescriptor.RelativeFileName)
            'oComp.Delete
            End If
            Next oComp
            End If
                       
        Next
End Sub

  

Markus Schrepfer
0 Likes
Message 4 of 8

A.Acheson
Mentor
Mentor

The step file just contains a solid body part and there was no errors opening. I got no assembly. Was the part attached what you were expecting? 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 5 of 8

m.schrepfer
Advocate
Advocate

@A.Acheson  schrieb:

The step file just contains a solid body part and there was no errors opening. I got no assembly. Was the part attached what you were expecting? 


The step file is correct. The error occurs as I load the assembly (look at my 1st post WORK-01-xxx-xxxxxxxx-D08-000.iam). At this point the message appears, that the reference to the step file is missing. In the next step I copied the step file into the location where expected and everthing works fine. But I must delete this reference in order to check the assembly into our PLM.

Markus Schrepfer
0 Likes
Message 6 of 8

A.Acheson
Mentor
Mentor
Accepted solution

This was a tricky one but I think I solved it with a combination of posts. 

  1. First you need to resolve the assembly with the current step file. 
  2. Then do a copy and reuse of the assembly using this post for work flow

https://knowledge.autodesk.com/support/inventor/troubleshooting/caas/sfdcarticles/sfdcarticles/Inven...

AAcheson_0-1625694851406.png

 

     3. Use the below rule to expose the underlying OLEFileDescriptor. 

https://forums.autodesk.com/t5/inventor-customization/ilogic-remove-unresolved-ole-links/td-p/681367...

Sub Main()
	Dim oDoc As AssemblyDocument = ThisApplication.ActiveDocument
	Dim oOLEFileRef As ReferencedOLEFileDescriptor
	
	For Each oOLEFileRef In oDoc.ReferencedOLEFileDescriptors
		oOLEFileRef.BrowserVisible = True
	Next

	MsgBox("Rule Complete!",,"iLogic")
End Sub

AAcheson_0-1625692750381.png

 

Then Delete the reference.

 

Hopefully That works for you. 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 7 of 8

m.schrepfer
Advocate
Advocate

Hi @A.Acheson ,

 

thank you for support - I´ll test your solution and come back soon!

Markus Schrepfer
0 Likes
Message 8 of 8

m.schrepfer
Advocate
Advocate

@A.Acheson 

Your solution works fine.

I´d only to make step 1 und step 2. After step 2 the references are displayed under Tools tab -> Options panel -> Links and I was able to delete the link.

 

Thank you for support!!!

 

Markus Schrepfer