Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Inventor 2022
API VB.NET VisualStudio
i try to Lose Reference or Break Link from each Part in Assembly.
This is a Assembly Example.
This is a Code, but is not working.
Code:
Public Sub CommandFunctionfweButton_28()
Dim oAsmDoc As AssemblyDocument = g_inventorApplication.ActiveDocument
Dim oAsmCompDef As AssemblyComponentDefinition = oAsmDoc.ComponentDefinition
Dim oTO As TransientObjects = g_inventorApplication.TransientObjects
Dim oTG As TransientGeometry = g_inventorApplication.TransientGeometry
Dim oBRep As TransientBRep = g_inventorApplication.TransientBRep
For Each oDocument As Document In oAsmDoc.AllReferencedDocuments
If oDocument.DocumentType = DocumentTypeEnum.kPartDocumentObject AndAlso oAsmCompDef.Occurrences.AllReferencedOccurrences(oDocument).Count > 0 Then
For Each oDerivedComp As DerivedPartComponent In oDocument.ComponentDefinition.ReferenceComponents.DerivedPartComponents
oDerivedComp.BreakLinkToFile()
Next
End If
Next
End Sub
Thanks for any Suggestion
Solved! Go to Solution.