cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Retrieve model

Marcusanthony
14-Alexandrite

Retrieve model

I retrieve model with ProMdlnameretrieve but I am not able to display it using toolkit.

 

I used ProMdlDisplay but still it does not work it stays in active session but do not get displayed in window.

 

What should I do?

 

1 REPLY 1
msteffke
14-Alexandrite
(To:Marcusanthony)

Ive done this several ways, i will paste a couple samples here.  Looks like Im still using the deprecated function but it should function the same. 

In this case i create and set a window current, then retrieve then display.  

 

ProWindowCurrentGet(&WindowId0);
        ProObjectwindowCreate(windowname, PRO_MDL_ASSEMBLY, &WindowId1);
ProWindowCurrentSet(WindowId1);
        tkerr = ProMdlRetrieve (name, PRO_MDL_ASSEMBLY, &mdlUnitDrawing);    
        if (tkerr == PRO_TK_NO_ERROR)
{
ProMdlDisplay(mdlUnitDrawing);
            ProWindowActivate(WindowId1);
------------------------------------------------------------------------------------------------------
 
In this case, the model was retieved, then a window created and set current, then Promdldisplay was used: 
tkerr = ProMdlRetrieve(modelName2, PRO_MDL_DRAWING, &mdlDrawing);
fprintf(fp, "retr %d\n", tkerr);
tkerr = ProObjectwindowCreate(modelName, PRO_MDL_DRAWING, &WinId);
fprintf(fp, "ob win %d\n", tkerr);
tkerr = ProWindowCurrentSet(WinId);
fprintf(fp, "win cur set %d\n", tkerr);
tkerr = ProMdlDisplay(mdlDrawing);
 
 
 

This code below is something I got from the user guide examples.

 

       /*  Retrieve an object  */
    if (err == PRO_TK_NO_ERROR && ret > 0)
    {
	ProStringToWstring(w_name_type, name);
    	err = ProMdlnameRetrieve (w_name_type, type, &model);
    	TEST_CALL_REPORT("ProMdlnameRetrieve ()",
                        "UserRestartProeTest()", err, err !=PRO_TK_NO_ERROR);

        /*  Display the object  */
        err = ProObjectwindowMdlnameCreate(w_name_type, (ProType)type, &w_id);
	TEST_CALL_REPORT("ProObjectwindowCreate()",
                        "UserRestartProeTest()", err, err !=PRO_TK_NO_ERROR);

        err = ProMdlDisplay(model);
	TEST_CALL_REPORT("ProMdlDisplay()",
                        "UserRestartProeTest()", err, err !=PRO_TK_NO_ERROR);

 

Announcements


Top Tags