Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

jlink help

smartanand

New member
hi


i have trouble in running a asynchronous jlink application.my system settings are


CLASSPATH:D:\jlink program\jlinktest;C:\Program Files\proeWildfire 2.0\text\java\pfcasync.jar;%.CLASSPATH.%.


PATH:C:\Program Files\proeWildfire 2.0\bin;C:\Program Files\Java\bin;C:\Program Files\proeWildfire 2.0\i486_nt\lib;%LD_LIBRARY_PATH%


PRO_COMM_MSG_EXE:C:\Program Files\proeWildfire 2.0\i486_nt\obj\pro_comm_msg.exe;



PRO_DIRECTORY:C:\Program Files\proeWildfire 2.0;


import com.ptc.cipjava.jxthrowable;
import com.ptc.pfc.pfcAsyncConnection.AsyncConnection;
import com.ptc.pfc.pfcAsyncConnection.pfcAsyncConnection;
import com.ptc.pfc.pfcModel.Model;
import com.ptc.pfc.pfcModel.ModelDescriptor;
import com.ptc.pfc.pfcModel.ModelType;
import com.ptc.pfc.pfcModel.pfcModel;
import com.ptc.pfc.pfcSession.Session;
public class getter
{
public static void main(String [] args)
{


try
{
System.loadLibrary("pfcasyncmt");
AsyncConnection connection=pfcAsyncConnection.AsyncConnection_Start(null,nul l);
//Session session = pfcGlobal.GetProESession();
//Model model = session.GetCurrentModel();
}
catch(Exception ex)
{
System.out.println("" + ex);
}



}
}


when i compiled it without commenting third and fourth lines in try block i got


D:\jlink program\jlinktest>javac getter.java
getter.java:18: cannot resolve symbol
symbol : variable pfcGlobal
location: class getter
Session session = pfcGlobal.GetProESession();
^
1 error



when i commented those lines it got compiled but while executing


i got this
D:\jlink program\jlinktest>javac getter.java


D:\jlink program\jlinktest>java getter
Warning: 2352 could not start message module 1073788865
com.ptc.pfc.Implementation.pfcExceptions$XToolkitGeneralErro r


can nay one tell wat went wrong?/


thanks in advance,


anand.c
 
Hi Anand,


your path setting are fine iwill attach a code which is in async mode to invoke proe and retrive a part file not any other type ( ASM, DRW etc)


pfcglobal is for synchronus mode only not async



import javax.swing.JFrame;
import javax.swing.JOptionPane;


import com.ptc.cipjava.jxthrowable;
import com.ptc.pfc.pfcAsyncConnection.AsyncConnection;
import com.ptc.pfc.pfcAsyncConnection.pfcAsyncConnection;
import com.ptc.pfc.pfcModel.Model;
import com.ptc.pfc.pfcModel.ModelDescriptor;
import com.ptc.pfc.pfcModel.ModelType;
import com.ptc.pfc.pfcModel.pfcModel;
import com.ptc.pfc.pfcSession.Session;



public class ActiveModel {

private static Session cursession;
private static String proe_cmd = "";
public static void main (String [] args){

if (args.length != 1)
{
System.out.println("Wrong number of arguments");
System.out.println("Usage: java pfcAsyncjlinkStartTest <proe_command>");
System.exit(1);
}
else
proe_cmd = args[0];

System.loadLibrary("pfcasyncmt");
JOptionPane.showMessageDialog(new JFrame(), "Async Library Loaded");
JOptionPane.showMessageDialog(null, "Now Pro E is going to Run");

try{
AsyncConnection connection = pfcAsyncConnection.AsyncConnection_Start (proe_cmd, null);
cursession = connection.GetSession();
String ModelName = JOptionPane.showInputDialog("enter model name");
ModelDescriptor desc = pfcModel.ModelDescriptor_Create(ModelType.MDL_PART, ModelName, null);
Model model = cursession.RetrieveModel(desc);
model.Display();
System.runFinalization();
System.exit (0);

}catch (jxthrowable x) {
// TODO: handle exception
System.out.println("Exception: "+x);
}
}

}






any proeblem reply me


christo Thomas






Edited by: christo_t
 
hi


i don't think that you're still looking for the solution, but i got it, so, maybe i could help someone else...


so the problem come from thie environment variable :


PRO_COMM_MSG_EXE:C:\Program Files\proeWildfire 2.0\i486_nt\obj\pro_comm_msg.exe;


you have to remove the ";" at the end of the value and it will work fine


(i tried with the ";" and i had the same problem than you, now it works fine).


Regards





Romain
 
What command are you suppose to pass to the main method so that it gets picked up by args and then passed to proe_cmd?
 

Sponsor

Articles From 3DCAD World

Back
Top