Delete referenced file

Delete referenced file

CadUser46
Collaborator Collaborator
1,866 Views
14 Replies
Message 1 of 15

Delete referenced file

CadUser46
Collaborator
Collaborator

Not as straight forward as it seems.  I have a file that refuses to disappear from the referenced files collection.  It does not show up in either BOM.rows or component occurences.

 

the delete method is not available for document or documentdescriptor so how to i delete this file?

 

Cheers


Craig

 

 

 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes
1,867 Views
14 Replies
Replies (14)
Message 2 of 15

Vladimir.Ananyev
Alumni
Alumni

Is it the only sick file or you find them quite often?

Have you an idea how this problem could be reproduced?

Could you upload this file?

 

cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 15

CadUser46
Collaborator
Collaborator

It's not the first time I have seen it but it happens so randomly I couldn't reproduce it. I'll upload the file tomorrow. 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes
Message 4 of 15

CadUser46
Collaborator
Collaborator

Attached the file you requested.


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes
Message 5 of 15

Vladimir.Ananyev
Alumni
Alumni

When I open your iam file in the Inventor 2015  the Resolve Link Dialog indicates the missing file   
asep\A1008639_Chainwheel_In_Work_01011581.ipt
 

After I skip this unresolved file reference I see the referenced files collection that is empty.

 

Capture.PNG


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 6 of 15

CadUser46
Collaborator
Collaborator

I had to doubt myself and wondered why i didnt try that already, then i remembered i did.  The reason i started looking for a vba solution is because the 'Links' button is greyed out.

Using Inventor 2012.

 

 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes
Message 7 of 15

Vladimir.Ananyev
Alumni
Alumni

Have you solved your problem?

cheers,


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 8 of 15

CadUser46
Collaborator
Collaborator

No.  Is there way to delete it with VBA?


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes
Message 9 of 15

Vladimir.Ananyev
Alumni
Alumni

No, unfortunately API does not provide any tools for this Smiley Sad


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 10 of 15

CadUser46
Collaborator
Collaborator

Any other suggestions?  I cant migrate the assembly right now.


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes
Message 11 of 15

Vladimir.Ananyev
Alumni
Alumni

Could you please describe your workflow when you solve this in the UI ?


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 12 of 15

CadUser46
Collaborator
Collaborator

Do you mean describe what im doing now? Or report back here when/if i do find a solution?

 

If its the first case i simply activate a project file in an completely empty directory, open the file, it tells me about the unresolved link which i then skip.  At this point the Links button is greyed out.

 

 


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes
Message 13 of 15

Vladimir.Ananyev
Alumni
Alumni

It is possible to open the document ignoring Resolve Links dialog.

Application.SilentOperation property helps to proceed the open file operation without prompting (if that gets required...e.g.: error message dismissal).

 

ThisApplication.SilentOperation = True
Set oDoc = ThisApplication.Documents.Open(filename, True)
ThisApplication.SilentOperation = False

In more complicated scenario you may consider FileAccessEvents.FireOnFileResolution method that could give you the unresolved filename. 


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 14 of 15

CadUser46
Collaborator
Collaborator

Vladimir, you're confusing me.  Go back to my OP.  I dont want to suppress the message, i need the link to the file removed without changing the file version from 2012


Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.

---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro
0 Likes
Message 15 of 15

Vladimir.Ananyev
Alumni
Alumni

Unfortunately I have no good news for you, sorry for that.  There isn’t a way to directly delete the references in an assembly.  They are created and removed as you do things that require a file reference.  But you may try to automate the workaround that works for you in UI.


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes