Open files with other file linked in Fx Parameters

Open files with other file linked in Fx Parameters

lstarke
Contributor Contributor
285 Views
1 Reply
Message 1 of 2

Open files with other file linked in Fx Parameters

lstarke
Contributor
Contributor

Hi, 

 

I'd like to understand why it works that way and how I can resolve my problem.

 

I'm trying to create a new or open a document, save copy as with a diferent name and link this copy in the main document.

 

Firt time it works but when I try the second time visual studio throw an argument exception. 

 

On debugging I saw that when I open the file with the link, it open in background the "save copy as" file too and in my opinion this couse the exception. Using document.close dont work and the only way is use documents.closeall.

 

Please, see my code attached and the video.

 

Thanks.

 

 

 

 

0 Likes
286 Views
1 Reply
Reply (1)
Message 2 of 2

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

First of all, I'm sorry but it's not clear to me what this is all about.

So you create a copy of a document, then reference it from the original document so that the parameters from the copy will be used.

Then you try to update the copy based on changes in the orginal document. What is the main purpose of all this?

If you clarify that, then maybe other people with similar workflows implemented in a different way that is working fine would share their solution with you.

 

Also, I can see that you are trying to recreate the connection to the new copy using deleteLink / addLink.

I would place the deleteLink before trying to create the copy using SaveAs. Hopefully if the link is not there then you'd be able to close the previously referenced document and overwrite it using SaveAs.

Then you could (re-)add the link to the new copy.

 

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes