Community Tip - You can change your system assigned username to something more personal in your community settings. X
I might be missing a point somewhere, but I'm trying to regenerate a Drawing. Sometimes the regenerate fails with Generel Error.
It seems to work if the drawing was already opened in Proe5, before my sync Jlink application is called.
If I have to open the drawing and display from the code the call fails. Is there any way to make sure the drawing is fully retrieved/displayed before calling the regeneration?
edit:
Actually i found that it fails if the model on the drawing is already displayed. If the model on teh drawing is in memory but not displayed itworks...
I tried to close the active window before opening the drawing, but that also failes.
Currently my code for loading and regeneration the drawing is roughly:
ModelDescriptor md = pfcModel.ModelDescriptor_CreateFromFileName("drawing.drw");
Model m = proeSession.RetrieveModel(md);
Window win = proeSession.CreateModelWindow(model);
win.Activate();
model.Display();
win.Refresh();
win.Repaint();
Drawing d = (Drawing)m;
d.Regenerate();
thanks,
\Bjarne Mortensen
Hi,
I use Creo Elements 5.0 M 120 and Drawing regeneration works very nice.
I use this code, its similar to yours I think.
if (mdl.GetType() == ModelType.MDL_DRAWING) {
((Drawing) mdl).Regenerate();
}
Best regards,
Eike
Aunt Edit:
Sry ... I have an async Java application. So I don't know about your problem.
I guess you're right
My problem was that I had a relation that needed to be regenerated on the drawing model. So I was looking in the wrong place.
I just needed to call RegenerateRelations() on the Model object
\Bjarne