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.

Register Log in

Proj view on drawing, J-link

paltsten

New member
<DIV>Hi...again </DIV>
<DIV>
Still having trubble with J-link (1st timer)
Trying to create a proj view on a drawing.
The input seems ok but the application ends with :
"com.ptc.pfc.Implementation.pfcExceptions$XToolkitBadInputs"
Most of the code I use in this method is from the pfcDrawingExamples.java.
I''ll attach part of the code and output/print message.

All help appreciated</DIV>
<DIV>//Peter </DIV>
<DIV></DIV>
<DIV></DIV>
<DIV>
DrawingCreateOptions options = DrawingCreateOptions.create();
options.insert (0, DrawingCreateOption.DRAWINGCREATE_WRITE_ERROR_FILE);</DIV>
<DIV> ModelDescriptor mdescr = curModel.GetDescr();
String newDrwName = curModel.GetInstanceName();
Drawing drw = session.CreateDrawingFromTemplate (newDrwName, predefinedTemplate, curModel.GetDescr(), options);</DIV>
<DIV> Model newDrawing = session.GetModel(newDrwName, ModelType.MDL_DRAWING);
Session session = pfcGlobal.GetProESession ();
Drawing drawing = (Drawing) newDrawing;
//View2Ds views = drawing.List2DViews ();
String viewName = "FRONT";
View2D view = drawing.GetViewByName(viewName);</DIV>
<DIV> printMsg("Vynamn: " + view.GetName());
dispMsg("Vynamn: " + view.GetName());</DIV>
<DIV> Outline3D outline = view.GetOutline();</DIV>
<DIV> printMsg (outline.get (0).get (0) + ", " + outline.get (0).get(1) + ", " + outline.get (0).get(2));
printMsg (outline.get (1).get (0) + ", " + outline.get (1).get(1) + ", " + outline.get (1).get(2));
dispMsg (outline.get (0).get (0) + ", " + outline.get (0).get(1) + ", " + outline.get (0).get(2));
dispMsg (outline.get (1).get (0) + ", " + outline.get (1).get(1) + ", " + outline.get (1).get(2));</DIV>
<DIV> Point3D pos = Point3D.create();</DIV>
<DIV> pos.set (0, outline.get (1).get (0) + (outline.get(1).get(0) - outline.get (0).get (0)));
pos.set (1, (outline.get (0).get(1) + outline.get (1).get(1))/2);
pos.set (2, 0.0);</DIV>
<DIV> printMsg (pos.get (0) + ", " + pos.get (1) + ", " + pos.get (2));
dispMsg (pos.get (0) + ", " + pos.get (1) + ", " + pos.get (2));</DIV>
<DIV> printMsg("Test1");
dispMsg("Test1");</DIV>
<DIV> ProjectionViewCreateInstructions pInstrs = pfcView2D.ProjectionViewCreateInstructions_Create (view, pos);</DIV>
<DIV> printMsg(pInstrs.GetParentView().GetName());
printMsg(pInstrs.GetLocation().get (0) + ", " + pInstrs.GetLocation().get (1) + ", " + pInstrs.GetLocation().get (2));
dispMsg(pInstrs.GetParentView().GetName());
dispMsg(pInstrs.GetLocation().get (0) + ", " + pInstrs.GetLocation().get (1) + ", " + pInstrs.GetLocation().get (2));</DIV>
<DIV> printMsg("Test2");
dispMsg("Test2");</DIV>
<DIV> drawing.CreateView (pInstrs);</DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV></DIV>
<DIV>
# Fri Apr 29 15:21:26 CEST 2005 # AGCadWindow: Vynamn: FRONT
# Fri Apr 29 15:21:26 CEST 2005 # AGCadWindow: 301.1904761904762, 369.49404761904765, -203.57142857142858
# Fri Apr 29 15:21:26 CEST 2005 # AGCadWindow: 413.09523809523813, 481.3988095238096, 203.57142857142856
# Fri Apr 29 15:21:26 CEST 2005 # AGCadWindow: 525.0, 425.4464285714286, 0.0
# Fri Apr 29 15:21:26 CEST 2005 # AGCadWindow: Test1
# Fri Apr 29 15:21:26 CEST 2005 # AGCadWindow: FRONT
# Fri Apr 29 15:21:26 CEST 2005 # AGCadWindow: 525.0, 425.4464285714286, 0.0
# Fri Apr 29 15:21:26 CEST 2005 # AGCadWindow: Test2
# Fri Apr 29 15:21:26 CEST 2005 # AGCadWindow: error in saveAsDxf(): com.ptc.pfc.Implementation.pfcExceptions$XToolkitBadInputs
# Fri Apr 29 15:21:32 CEST 2005 # AGCadWindow: Exit from program...
# Fri Apr 29 15:21:35 CEST 2005 # AGCad: AGCad stopped
</DIV>
<DIV></DIV>
 

Sponsor

Top