Message 1 of 16

Not applicable
09-16-2018
11:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have made a code to break link of ipart in assembly with parent factory. It works in one assembly and it doesen't work in a another. Please Help i can't find the problem
SyntaxEditor Code Snippet
Dim asmDoc As AssemblyDocument asmDoc = ThisApplication.ActiveDocument Dim oDoc As Document = ThisDoc.Document Dim oCompDef As Inventor.ComponentDefinition = oDoc.ComponentDefinition Dim occ As Inventor.ComponentOccurrence Dim partCompDef1 As PartComponentDefinition Dim partCompDef2 As PartComponentDefinition Dim factoryDoc As PartDocument 'Dim oPart As PartDocument Dim i As Long=1 For Each occ in oCompDef.Occurrences occ = asmDoc.ComponentDefinition.Occurrences(i) If occ.IsiPartMember Then partCompDef1 = occ.Definition factoryDoc=partCompDef1.iPartMember.ReferencedDocumentDescriptor.ReferencedDocument Dim oPart As PartDocument For Each oPart In factoryDoc.ReferencedDocuments MessageBox.Show("Message", "Title") oPart.ComponentDefinition.iPartMember.BreakLinkToFactory Next End If i=i+1 Next
Solved! Go to Solution.