Reply

"Cannot save the file. You may not have write-access for the file or the directory."

[ Edited ]

 

Hello!

I have been working on a set of code which works through a complete assembly structure, making custom parameter changes to certain components and then saving those models.  However, some components when saved bring up a SolidEdge message saying "Cannot save the file. You may not have write-access for the file or the directory."

Calling partDoc->SeekWriteAccess() always returns VARIANT_FALSE for these specific components.

Calling partDoc->Activate() does not appear to make any difference.

Is anyone aware of any function I can call to change this model from read to write access? - Or to try and determine why they are marked as read-only?

I am using SolidEdge v19 Update 11 and the code is all developed in C++.

Oddly, it works on one machine and does not on two other machines, which implies that maybe the files themselves are actually readonly on the file system (the files are in the same directory as other files which do save ok, so I donot think the directory permission is a problem).  But, I have checked the NT permissions, read-only attribute, etc... and they all seem ok.

Thanks,

Chris.

 

Posted by: chris mann
Post date: 1/15/2008 6:03:02 AM

2 REPLIES

RE: "Cannot save the file. You may not have write-access for the file or the directory."

[ Edited ]

Chris,

 

I can think of a multitude of reasons this would occur. I've seen problems like this when you hold COM references without releasing them. This problem actually occurs on it's own from time to time in Solid Edge. It probably has nothing to do with the files being read-only. You can test that theory by disabling your addin and saving the documents. The only advice that I know to give is go over your code with a fine tooth comb and try to eliminate (narrow down) as much code as possible. i.e. Down to bare bones functionality.

 

Posted by: Jason Newell
Post date: 1/15/2008 3:20:25 PM

RE: "Cannot save the file. You may not have write-access for the file or the directory."

[ Edited ]

Jason,

 

Thanks for the feedback - The code in question is in rather a large data management application and is somewhat difficult to reduce much further - New test projects dont exhibit the same problems, which makes it very frustrating to try and work around.

 

Thanks for you help and suggestions, though!

 

Thanks,

Chris.

 

Posted by: chris mann
Post date: 1/16/2008 2:15:27 AM