Skip to main content
14-Alexandrite
December 4, 2023
Solved

Automatic export of files from Windchill to shared network location.

  • December 4, 2023
  • 2 replies
  • 2796 views

For Creo Parametric, I would like to store the "Controlled" versions of files in Windchill (Primarily things like symbols and manikin configuration files)  but have Windchill do a nightly or hourly write of those files to shared network locations so that the common Robocopy method can be used to pull the files to the users local machines.   (Creo has slow down issues when reading symbols and manikin poses from Windchill directly).    Is this possible?  Can I be pointed to the correct terminology or relevant help files.    

 

Even better would be if there is a way for Windchill to update the users local Creo Parametric files without needed to use RoboCopy.   Thanks for any help or direction.

 

(Using Creo 9 and Windchill 12.  But should be moving to W13 soon)

Best answer by HelesicPetr

Hello @N.Barnes 

Definitely you need a configuration and customization knowledge. 

 

It is not so hard to explain buy you need someone who can apply a code to the workflow and also who knows a risk of the code.

For example if you use a code downloaded from PTC it is save to use, but if you do not understand the code, it is hard to recognize if there is everything alright šŸ˜„

 

An example how to download a file to a network/server disk is shown in a AfterEDRloader

CS216668 - An example Afterloader hook method

a section Optionally download a copy of the EPM Document's attachments 

 

this is just snip of code for the downloading from the AfterEDRloader class provided by PTC.

If you get primary file then you can do it same way - get Primary - get primary ApplicationData save it to the drive on the server... 

String directory = "";
if (downloadToLocal)
{
	// get epmDoc info
//				String container = WTContainerHelper.getContainer(epmDoc).getName();
//				String authapp = epmDoc.getAuthoringApplication().toString();
//				String epmdocType = epmDoc.getDocType().toString();
	String localDir = getDownloadToLocalDir();
	if (localDir.equals(""))
	{
		downloadToLocal = false;
	} else
	{
		SimpleDateFormat fm = new SimpleDateFormat("yyyy-MM");
//					File dir = new File(localDir + File.separator + "Design_deliverables" + File.separator + container + File.separator + authapp + File.separator + epmdocType + "_" + fm.format(Calendar.getInstance().getTime()));
		File dir = new File(localDir + File.separator + fm.format(Calendar.getInstance().getTime()));
		if (dir == null || !dir.exists())
		{
			dir.mkdirs();
		}
		directory = dir.getAbsolutePath();
	}
}
public static String downloadContent(EPMDocument epmDoc, ApplicationData appData, String dir, String fromFileName, String toFileName)
{
String ret = "";
try
{
	// Download ApplicationData
	File contentFile = FileHelper.getFileContent(epmDoc, appData, dir, null);
	if (!fromFileName.equalsIgnoreCase(toFileName))
	{
		FileUtil.moveFile(dir, fromFileName, toFileName);
	}
	ret = contentFile.toString();
	System.out.println("downloadContent..." + ret);

} catch (Exception e)
{
	e.printStackTrace();
}

return ret;
}

the code could be used  in own class and then call it from workflow or 

the code can be modified for the direct workflow expression robot and use it directly in the WF. WF expression has limit to 4k characters so you can not write long code in the wf expression . 

PetrH

2 replies

Community Moderator
December 7, 2023

Hi N.Barnes,

Thank you for your question. 
I’d like to recommend to bring more details and context to your initial inquiry. It also helps to have screenshot(s) to better understand what you are trying to do in your process. 

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

Regards,

Community moderation team.

N.Barnes14-AlexandriteAuthor
14-Alexandrite
December 7, 2023

NBarnes_1-1701960631126.png

 

23-Emerald III
December 7, 2023

A lot of extra work for very little gain!

All of our symbols, material files and ModelCheck configuration files are stored on a network drive. I do not notice any delay when adding a symbol to our drawings or changing material properties. Creo is also loaded on the network drive. There is a little delay in launching Creo, but it is livable. When I do an upgrade to Creo, I install it once on the network drive, change a few lines in my Creo Launch script to point to the new loadpoint and the users now have the new version the next time they launch Creo.

N.Barnes14-AlexandriteAuthor
14-Alexandrite
December 11, 2023

Ben, I agree.   Before remote support became using a common network location was great. Due to some users access the network though VPN's and remote locations with inconsistent speed the remote files are less attractive now.