smartanand
New member
package com.ptc.ParamExample;
import com.ptc.cipjava.*;
import com.ptc.pfc.pfcSession.*;
import com.ptc.pfc.pfcGlobal.pfcGlobal;
import com.ptc.pfc.pfcModel.*;
import com.ptc.pfc.pfcModelItem.Parameter;
import com.ptc.pfc.pfcModelItem.ParamValue;
import javax.swing.JOptionPane;
public class ParamEx
{
private static Session cursession;
public static void start()
{
String path = "C:\\ptc\\jlink\\jlink_appls\\ParamExample";
ModelDescriptor descr;
Model model;
String modelname = "Test.prt";
try
{
descr = pfcModel.ModelDescriptor_Create (ModelType.MDL_PART, modelname, null);
descr.SetPath(path);
cursession = pfcGlobal.GetProESession ();
model = cursession.RetrieveModel(descr);
Parameter diameter = model.GetParam("Diameter");
ParamValue diaValue = diameter.GetStringValue();
msgBox(diaValue);
model.Display();
}
catch (jxthrowable e)
{
e.printStackTrace();
}
}
public static void msgBox (String msg)
{
String title = "ProE";
JOptionPane.showMessageDialog (new java.awt.Frame (),msg,title + " Error",JOptionPane.ERROR_MESSAGE);
}
public static void stop ()
{
printMsg ("stopped");
}
private static void printMsg (String msg)
{
System.out.println ("ParamEditor: " + msg);
}
}
my protk.dat file has,
name&n bsp; Password
startup  ; java
java_app_class com.ptc.PasswordExample.Password
java_app_start start
java_app_stop stop
allow_stop true
delay_start false
text_dir $PRO_DIRECTORY/jlink/jlink_appls/ParamExample/text
end
while starting ProE, I am getting a application start up failed error message.
Please tell whether there is any problem with my code.
If any one know how to debug this jlink application, please tell me.
I am in great need to solve this problem.
Please help me.
Thanks
Anand.C
import com.ptc.cipjava.*;
import com.ptc.pfc.pfcSession.*;
import com.ptc.pfc.pfcGlobal.pfcGlobal;
import com.ptc.pfc.pfcModel.*;
import com.ptc.pfc.pfcModelItem.Parameter;
import com.ptc.pfc.pfcModelItem.ParamValue;
import javax.swing.JOptionPane;
public class ParamEx
{
private static Session cursession;
public static void start()
{
String path = "C:\\ptc\\jlink\\jlink_appls\\ParamExample";
ModelDescriptor descr;
Model model;
String modelname = "Test.prt";
try
{
descr = pfcModel.ModelDescriptor_Create (ModelType.MDL_PART, modelname, null);
descr.SetPath(path);
cursession = pfcGlobal.GetProESession ();
model = cursession.RetrieveModel(descr);
Parameter diameter = model.GetParam("Diameter");
ParamValue diaValue = diameter.GetStringValue();
msgBox(diaValue);
model.Display();
}
catch (jxthrowable e)
{
e.printStackTrace();
}
}
public static void msgBox (String msg)
{
String title = "ProE";
JOptionPane.showMessageDialog (new java.awt.Frame (),msg,title + " Error",JOptionPane.ERROR_MESSAGE);
}
public static void stop ()
{
printMsg ("stopped");
}
private static void printMsg (String msg)
{
System.out.println ("ParamEditor: " + msg);
}
}
my protk.dat file has,
name&n bsp; Password
startup  ; java
java_app_class com.ptc.PasswordExample.Password
java_app_start start
java_app_stop stop
allow_stop true
delay_start false
text_dir $PRO_DIRECTORY/jlink/jlink_appls/ParamExample/text
end
while starting ProE, I am getting a application start up failed error message.
Please tell whether there is any problem with my code.
If any one know how to debug this jlink application, please tell me.
I am in great need to solve this problem.
Please help me.
Thanks
Anand.C