Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
package com.ptc.jlinkasyncexamples;
import com.ptc.cipjava.*;
import com.ptc.pfc.pfcSession.*;
import com.ptc.pfc.pfcModel.*;
import com.ptc.pfc.pfcAsyncConnection.*;
/**
* This asynchronous class is a simple asynchronous application. It makes
* Pro/ENGINEER run in batch mode, without user input. The application
* starts Pro/ENGINEER, performs the designated operations, and shuts down
* Pro/ENGINEER.
*/
public class pfcAsyncStartExample {
public static void main (String [] args)
{
System.loadLibrary("pfcasyncmt");
runProE();
}
public static void runProE()
{
try
{
// Second Argument: String path to menu and msg files.
// null assumes no msg and menu files used in this batch application.
// -i and -g flags make Pro/ENGINEER run in non-graphic, non-interactive mode.
AsyncConnection connection =
pfcAsyncConnection.AsyncConnection_Start("pro -g:no_graphics -i:rpc_input",
null);
Session session = connection.GetSession();
/* J-Link processing calls here */
//null third argument designates model is not an instance.
ModelDescriptor desc = pfcModel.ModelDescriptor_Create(ModelType.MDL_PART, "modelname",null);
Model model = session.RetrieveModel(desc);
// end the Pro/ENGINEER process when done
connection.End();
}
catch (jxthrowable x)
{
System.out.println("Exception: " + x);
}
}
}
Error: Could not find or load main class PfcAsyncStartExample ?????
How to run this or to clear this error
Hi,
Read the following article - "OTK JAVA Free samples pfcAsyncFullExample.java & pfcAsyncStartExample.java loads incorrect Library "jotkasync". The correct Library should be "pfcasyncmt" in Creo Parametric": https://www.ptc.com/en/support/article/CS312023
I have applied that pfcasyncmt ? but also main class is not running