Message 1 of 7
Replacing Referenced Document in Drawing does not update until its re-opened.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have found the code to replace the referenced document as shown below:
doc = ThisDoc.Document oView = ActiveSheet.DrawingViews.NativeEntity.Item(1) Dim oFD As FileDescriptor 'CALL ON INVENTORS "REFERERENCE MODEL" API oFD = doc.ReferencedFileDescriptors(1).DocumentDescriptor.ReferencedFileDescriptor 'REPLACE REFERENCED MODEL WITH PART THAT HAS SAME NAME AS DRAWING oFD.ReplaceReference(ThisDoc.Path & "\" & ThisDoc.FileName & ".ipt") doc.Update
However, when run it changed the "Referenced model" but it doesnt actually update it within the drawing? If I close and re-open, it shows up correctly. I tried writing some extra code to close and re-open the drawing but no dice. Im hoping theres a simple solution im missing here.