Skip to main content
12-Amethyst
November 25, 2024
Question

Programatically how to checkin the CAD object in workpsace

  • November 25, 2024
  • 2 replies
  • 1108 views

I Added all the part structure and its associated CAD into the workspace, i able to do checkout, but not the check-in.
is there any api to do check-in the CAD Object in workspace.

2 replies

Catalina
Community Moderator
November 25, 2024

Hi RaikarRaghu

 

Thank you for your question! 

 

I’d like to recommend to bring more details and context to your initial inquiry. 

Please consider adding screenshot(s) to better understand what you are trying to do in your process. 

 

Please refer to this guideline to make your questions more likely to receive a quick and useful answer. 

This will increase your chances to receive meaningful help from other Community members. 

 

Thank you for your participation and please let me know if you need further assistance! 

 

Best regards,

Catalina | PTC Community Moderator
12-Amethyst
November 26, 2024

Hello Catalina,

I have programmatically added objects to the workspace and checked them out. However, I am unable to check them back in using the same approach. Could you please suggest any available APIs for checking in objects in the workspace.

 

Please find the below image for your reference.

RaikarRaghu_0-1732599262333.png

 

I have performed the checkout action using the below code.

 

wt.fc.ReferenceFactory referenceFactory = new wt.fc.ReferenceFactory();
String workspaceNumber = getWorkspaceNumberFromName();
EPMWorkspace workspace = (EPMWorkspace) referenceFactory.getReference(workspaceNumber).getObject();
 
if (!WorkInProgressHelper.isCheckedOut(epmdocument)) {
                CheckoutLink chilink = WorkInProgressHelper.service.checkout(epmdocument, workspace.getFolder(), WorkspaceName);
wt.epm.EPMDocument wrk = (wt.epm.EPMDocument) chilink.getWorkingCopy();
System.out.println("Document checked out successfully: " + wrk.getIdentity() +"<-->"+wrk.getNumber());
}
12-Amethyst
November 27, 2024

I have programmatically added objects to the workspace and checked them out. However, I am unable to check them back in using the same approach. Could you please suggest any available APIs for checking in objects in the workspace.

 

 

I have performed the checkout action using the below code.

 

wt.fc.ReferenceFactory referenceFactory = new wt.fc.ReferenceFactory(); String workspaceNumber = getWorkspaceNumberFromName(); EPMWorkspace workspace = (EPMWorkspace) referenceFactory.getReference(workspaceNumber).getObject();

  if (!WorkInProgressHelper.isCheckedOut(epmdocument)) {                

CheckoutLink chilink = WorkInProgressHelper.service.checkout(epmdocument, workspace.getFolder(), WorkspaceName); wt.epm.EPMDocument wrk = (wt.epm.EPMDocument) chilink.getWorkingCopy(); System.out.println("Document checked out successfully: " + wrk.getIdentity() +"<-->"+wrk.getNumber()); }

HelesicPetr
22-Sapphire II
22-Sapphire II
November 27, 2024

Hi @RaikarRaghu 

If you try to check in what is your problem? you do not provide any errors . If you say it does not work, that means nothing. 

Logs are the most important point for solving a troubles

PetrH

12-Amethyst
December 2, 2024

Hello Petr,

If any CAD object added to workspace, then do checkout of that CAD Object it won't allow you do check-in, in the workspace, until unless it has to open in CAD Tool and do save or do some modification in that CAD, then it will allow do check-in. from CAD tool or in the workspace.

This is my understanding correct me if i am wrong.

 

Raikar