Hi all,
I was tryinh Async mode in J-Link , can any body tell me cow to connect the existing proe session and retrive a model see the code below same attached also. 2006-03-18_075449_ActiveModel.zip
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_Connect(null, null, null, 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);
}
}
}
I was tryinh Async mode in J-Link , can any body tell me cow to connect the existing proe session and retrive a model see the code below same attached also. 2006-03-18_075449_ActiveModel.zip
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_Connect(null, null, null, 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);
}
}
}