Retrieve model
Dec 18, 2024
02:42 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Dec 18, 2024
02:42 PM
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?
Labels:
- Labels:
-
ProToolkit
2 REPLIES 2
Dec 18, 2024
03:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Dec 18, 2024
03:10 PM
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);
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);
Jan 07, 2025
04:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Jan 07, 2025
04:01 AM
Hello, I am able to retrieve model but it does not display in window. The model stays in session. How can I display it?
