Message 1 of 5
Replace Refference problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I amtrying to replace the reffernce of the unroslved file in the assembly
C:\Users\Marko\Desktop\3D\Workspace\Assembly3_6\Sklop\Assembly3_n1
When i run the rule in this file it won't replace the reference, but if i change the line higlithed in red
to any other file this code works.
I have attached the files in the attachment
This is driving me crazy please help
Sub Main() Dim oDoc As AssemblyDocument oDoc = ThisApplication.ActiveDocument Dim oCompDef As ComponentDefinition oCompDef=oDoc.ComponentDefinition Dim occ As ComponentOccurrence For Each occ In oCompDef.Occurrences If occ.Name="" Then GoTo 1: If occ.IsSubstituteOccurrence = "True" Then GoTo 1 : Try If occ.Definition.Type =ObjectTypeEnum.kWeldsComponentDefinitionObject Then GoTo 1: Catch End Try If occ.DefinitionDocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then occ.ReferencedDocumentDescriptor.ReferencedFileDescriptor.ReplaceReference("C:\Users\Marko\Desktop\Reduktor1\Workspace\Assembly3_6\Assembly3_n1.iam") End If 1: Next End Sub