Skip to main content
16-Pearl
November 13, 2023
Solved

How to get IsObjectCheckedOut ?

  • November 13, 2023
  • 1 reply
  • 1431 views

Hi there,

 

in the web.link "documentation" there is a function

 

 

boolean IsObjectCheckedOut (string WorkspaceName, string ObjectName) 

 

 

within the "Class pfcServer"

 

I tried

 

 

let active_ws = oSession.ListServers().Item(0).ActiveWorkspace;
console.log (oSession.IsObjectCheckedOut(active_ws , CurModel.Filename)); 

 

 

 

But I only get "TypeError: oSession.IsObjectCheckedOut is not a function"

 

How do I get the information, if an object is already checked out?

 

 

 

Best answer by YaroslavSin

This method is from IpfcServer not from Session object

IpfcServer.IsObjectCheckedOut()

1 reply

17-Peridot
November 14, 2023

This method is from IpfcServer not from Session object

IpfcServer.IsObjectCheckedOut()
Mat16-PearlAuthor
16-Pearl
November 14, 2023

Thanks for Your reply.

 

Unfortunately, there is no "IpfcServer" Class in Web.Link. I guess, that there is a IpfcServer in VB - Toolkit.

The according Class in Web.Link is simple called "pfcServer".

 

That said, the solution is quite straight forward:

 

 

let active_server = oSession.ListServers().Item(0); //usually, there is only one Windchill - server registered
let active_workspace = active_server.ActiveWorkspace;
let FileName = EPMObject.FileName;
return active_server.IsObjectCheckedOut(active_workspace , FileName ); // returns "false" / "true"

 

Edit:

by the way, there was a typo in my original post.
There is no property "Filename" for "CurModel". It should have been "CurModel.FileName".