cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Programatically how to checkin the CAD object in workpsace

RaikarRaghu
12-Amethyst

Programatically how to checkin the CAD object in workpsace

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.

8 REPLIES 8

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

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());
}

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()); }

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

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

Hi @RaikarRaghu 

Generally you are right from a process perspective , but there is an option where you can force the check-in in a UI even though it is not modified or opened in a CAD Tool,

So the option to check-in from workspace has to exist

So please share an error log where your function failed to check-in from workspace.

 

Additionally>

Windchill has a mechanism to build a structure from the WTPart to CADDocument 

In a compare wizard, you can chose a Workspace where the CAD is modified from the WTPart Structure by Build One/Multi-Level CAD Structure

So Check-In from workspace API exists on the server side. 

HelesicPetr_2-1733128784524.png

 

HelesicPetr_1-1733127512777.png

Workspace SetForCheckIn

HelesicPetr_1-1733128659090.png

PetrH. 

Hi @RaikarRaghu 

btw I tried to check in a CADModel from a workspace and I haven't found any problem 

HelesicPetr_3-1733133239328.png

HelesicPetr_0-1733133541065.png

 

 

EPMDocument checkedInObjects = (EPMDocument) WorkInProgressHelper.service.checkin(epmDoc, "checkInFrom WS");

 

PetrH

Hello PetrH,

 

Thank you

now its working fine no issues. 

one more dought i have, i added one assembly in the workspace i do checkout and checkin, after checkin i want to remove the added things from the workpspace, how to achive this.

 

please refer below the image for your understanding. (after checkin i need to remove all the added things from the workspace)

RaikarRaghu_0-1733238755172.png

 

 

Raikar

Announcements

Top Tags