Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Owner2229
480 Views, 1 Reply

Canceling document's check-out

Hi, I'm looking for a programmatic way of canceling document's check-out status.

 

The check-out status can be found in iProperties on "Status" tab, down in the "File status" field.

In the past we've used in our company some shared projects, so we don't overwrite our work and the status stayed written in some of the documents.

Now, here are the problems:

A) When someone opens any of these documents, they won't be allowed to save any changes since the document is checked out for someone else and no-one can neither check it back nor force the check out, since it's not enabled in the single-user project.

B) When I'm programmatically trying to replace the mentioned file's references (in apprentice) I'll get a generic error "parameter is not correct".

I've tried all of the following and in some cases it actually would replace one or two references (due to an error, I guess, since for every reference works a different or none of the listed methods), but that is way below reliable.

 

Dim oDoc As Inventor.ApprenticeServerDocument = ...
Dim Position As Integer = ... oDoc.File.ReferencedFileDescriptors(Position).ReplaceReference("%New path%") oDoc.ReferencedDocumentDescriptors(Position).ReferencedFileDescriptor.ReplaceReference("%New path%") oDoc.ReferencedFileDescriptors(Position).PutLogicalFileNameUsingFull("%New path%") oDoc.ReferencedFileDescriptors(Position).PutLogicalFileNameUsingFullSpl("%New path%")

Thanks for any help of leads to solution.

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods