Morfmor
Mechanical
- Feb 26, 2008
- 8
I have made a small JLink application that opens a drawing with the same name as the current part/assy.
We're moving from WF2 to WF4 now, and in WF4 it just freezes Pro/E. Other JLink applications runs as usual, so the installation is OK.
Does anyone know of any changes that would affect this application?:
//26-Sep-02. Per Bøwadt Møller
import java.awt.*;
import javax.swing.*;
import com.ptc.cipjava.*;
import com.ptc.pfc.pfcSession.*;
import com.ptc.pfc.pfcGlobal.*;
import com.ptc.pfc.pfcModel.*;
public class OpenDraw{
private static Session curSession=null;
private static Model model=null;
private static String modelName="";
private static ModelDescriptor descr;
private static ModelType modTyp=com.ptc.pfc.pfcModel.ModelType.MDL_DRAWING;
static Frame pfcFrame = new Frame();
public static void start (){
try{
curSession = pfcGlobal.GetProESession();
model=curSession.GetCurrentModel();
modelName=model.GetInstanceName();
descr = pfcModel.ModelDescriptor_Create (modTyp, modelName, null);
curSession.OpenFile(descr);
}
catch (jxthrowable jxth){
mes("Tegningen kunne ikke findes!");
jxth.printStackTrace ();
}
stop();
}//end start
//=========================================================================
public static void stop (){
}
//=========================================================================
private static void mes(String message){ //Pop-op boks
JOptionPane.showMessageDialog ( pfcFrame, message,
"Message from Jlink!", JOptionPane.INFORMATION_MESSAGE );
}//end mes
}
We're moving from WF2 to WF4 now, and in WF4 it just freezes Pro/E. Other JLink applications runs as usual, so the installation is OK.
Does anyone know of any changes that would affect this application?:
//26-Sep-02. Per Bøwadt Møller
import java.awt.*;
import javax.swing.*;
import com.ptc.cipjava.*;
import com.ptc.pfc.pfcSession.*;
import com.ptc.pfc.pfcGlobal.*;
import com.ptc.pfc.pfcModel.*;
public class OpenDraw{
private static Session curSession=null;
private static Model model=null;
private static String modelName="";
private static ModelDescriptor descr;
private static ModelType modTyp=com.ptc.pfc.pfcModel.ModelType.MDL_DRAWING;
static Frame pfcFrame = new Frame();
public static void start (){
try{
curSession = pfcGlobal.GetProESession();
model=curSession.GetCurrentModel();
modelName=model.GetInstanceName();
descr = pfcModel.ModelDescriptor_Create (modTyp, modelName, null);
curSession.OpenFile(descr);
}
catch (jxthrowable jxth){
mes("Tegningen kunne ikke findes!");
jxth.printStackTrace ();
}
stop();
}//end start
//=========================================================================
public static void stop (){
}
//=========================================================================
private static void mes(String message){ //Pop-op boks
JOptionPane.showMessageDialog ( pfcFrame, message,
"Message from Jlink!", JOptionPane.INFORMATION_MESSAGE );
}//end mes
}