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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Accessing WS and CS to find the part

eparamasivam
1-Visitor

Accessing WS and CS to find the part

I need to search the part from the creo using Web.link . once i start the search i will look into the ws if it is not there it needs to goto windchill WS or CS and then check out and download into the creo location.

function ToGetWSName()

{

  var mGlob = pfcCreate("MpfcCOMGlobal");

  var oSession = mGlob.GetProESession();

  var CurServer = oSession.GetActiveServer() ;

  var ActServer = CurServer.Alias ;

  var ActWorkspace = CurServer.ActiveWorkspace ;

  ws_path = "wtws://"+ActServer+"/"+ActWorkspace+"/" ;

  return ws_path ;

}

this is the code i used to get the WS . can any one help me to search from CS and checkout and dowmload into Creo??

1 REPLY 1

I have never actually checked out a model with weblink however the pfcServer.CheckOutObjects() and pfcCheckoutOptions deal with checking out objects. Since you are linked to Windchill you don't need to "search" for a model you can simply just "open it" and if it is not already in the workspace then it will be added to your workspace and then opened.

To open a model in weblink would go something like this.

Assume you have xyz.prt (that may or may not be in the workspace) that you want to open and display in a window.

var modelTypeClass = pfcCreate("pfcModelType");

var modelDescriptor = pfcCreate("pfcModelDescriptor").Create(modelTypeClass.MDL_PART, "xyz", null);//creating the model descriptor

var model = session.RetrieveModel(modelDescriptor);//retrieving the model into session.

//At this point you can work with the model in WebLink you do not need to open in Window

var session = pfcGetProESession();

var window= session.CreateModelWindow(model);//create a window

model.Display();//display the window

window.Activate();//activate the window

Announcements


Top Tags