Skip to main content
1-Visitor
December 20, 2016
Question

Can we lock/unlock a model in workspace using ProToolkit API?

  • December 20, 2016
  • 2 replies
  • 1794 views

In Creo integrated with Windchill, the top level assembly only is checked-out , and bottom parts are in check-in status.

Can we put a lock to the bottom parts to prevent them from modification using ProToolkit API?

In interactive mode it is supported (PFA).

2 replies

15-Moonstone
January 6, 2017

You can't prevent it. But you can check it inside your toolkit program before you change it from this side.

  pfcSession_ptr session = pfcGetProESession();

  pfcServer_ptr server = NULL;

  server = session->GetActiveServer();

  checkedout = server->IsObjectCheckedOut(server->GetActiveWorkspace(), mdl->GetFileName());

Br,

Eike

13-Aquamarine
January 6, 2017

As far as I know you can only check the status.

Function ProServerObjectIsModified

Description
Checks if the given object is modified in workspace/locally.
Synopsis
#include <ProWTUtils.h>
ProErrorProServerObjectIsModified(
wchar_t* server
/* (In)
The server alias.
*/
wchar_t* workspace
/* (In)
The workspace name.
*/
wchar_t* object_name
/* (In)
The object name
*/
ProBoolean* checkout_status
/* (Out)
PRO_B_TRUE if the object is currently checked out.
*/
ProBoolean* modifiedLocally
/* (Out)
PRO_B_TRUE if the object is checked out and modified.
*/
ProBoolean* modifiedInWS
/* (Out)
PRO_B_TRUE if the object got modified in Workspace.
*/
)
Returns
PRO_TK_NO_ERRORThe function succeeded.
PRO_TK_BAD_INPUTSOne or more arguments was invalid.
PRO_TK_E_NOT_FOUNDThe given object is not in the workspace.
PRO_TK_BAD_CONTEXTThe server was not registered or the workspace couldn't be found on the server.