Break link to insert files

Break link to insert files

eladm
Collaborator Collaborator
563 Views
1 Reply
Message 1 of 2

Break link to insert files

eladm
Collaborator
Collaborator

Hi

To a part I have a link to a file (from insert object or  stress analysis)  , so I get the file in the model browser and also at tools- links

eladm_0-1678027308472.png

I want to disable/delete this links , but from the assembly . I want to delete this links to all the parts that have links

(not open the file 1 by 1 )

 

regards

0 Likes
Accepted solutions (1)
564 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor
Accepted solution

Hi @eladm.  You can give something like this a try (code below).  However, this is a big step, so you may want to put a prompted question in there, which will pause to ask the user if they are sure they want to go ahead with this step.  But that's up to you.

Dim oDoc As Document = ThisDoc.Document
Dim oRefDocs As DocumentsEnumerator = oDoc.AllReferencedDocuments
If oRefDocs.Count = 0 Then Exit Sub
For Each oRefDoc As Document In oRefDocs
	Dim oRefOLEFileDs As ReferencedOLEFileDescriptors = oRefDoc.ReferencedOLEFileDescriptors
	If oRefOLEFileDs.Count = 0 Then Continue For
	For Each oRefFileD As ReferencedOLEFileDescriptor In oRefOLEFileDs
		Try : oRefFileD.Delete : Catch : End Try
	Next
Next

If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes