Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Using the code below I am able to create drawings using a template of all model types other then family table generics. When the model is a generic the code will not execute properly.
WhenI try to manually follow the steps in Pro/ENGINEER fr creating a drawing from atemplateif I select a family table generic as the model for the drawing it prompts me again to select a model from the family table, generic or instance.
How do I programatically tell Pro/ENGINEER to use the generic model for the drawing from template? Am I going about this the wrong way?
Scott
public static Drawing drawingFromTemplate (Model model, String drawingName, String template){
Drawing drawing = null;
try{
Session session = pfcGlobal.GetProESession();
Utilities.log("Creating drawing instructions");
DrawingCreateOptions options = DrawingCreateOptions.create();
options.insert(0, DrawingCreateOption.DRAWINGCREATE_DISPLAY_DRAWING);
Utilities.log("Creating drawing from template "+template);
drawing = session.CreateDrawingFromTemplate(drawingName, template, model.GetDescr(), options);
Utilities.log("Drawing created");
}
catch (jxthrowable e){
Utilities.log("JLink Exception creating drawing from template");
Utilities.log(e);
}
return drawing;