Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hello! Could you please tell me how can I get vertices, faces and colors oof the part or assembly parts in Pro/E Wildfire 4.0 using Pro/Toolkit (c++).
Hello Vladimir,
how to do it, is nothing to explain in a few words in a thread.
I can just say that it is possible by accessing the geometry data of the model and that there are some examples about how to access that.
With colors you need to be aware that there are several levels of coloring possible for each surface (part surface color, model color and color assigned in assembly), so it depends whether you want to get the color currently showing or an underlying color.
Regards,
Gunter
Hello Gunter,
It is quite clear. I do not want you to repeat chapters of user manual. However, could you please give me any clue/hint where to find.
Regards,
Vladimir
Hello Vladimir,
I would start with the section "Visiting Solid Geometry" under the chapter "Core: 3D Geometry".
It explains in short, how to traverse down to the geometry items for vertices and faces.
ProSolidSurfaceVisit() and/or ProSolidQuiltVisit() are probably functions you will need at the top of traversing.
To get the colors of surfaces, I would use ProSurfaceAppearancepropsGet()
There are useful links from the function descriptions to User's Guide and sample code.
Regards,
Gunter
Hello Gunter,
I could not find ProSurfaceAppearancepropsGet(). However, I could get
color in the following way:
lPart = pro_get_current_object();
props = (Pro_surf_props *)calloc(1, sizeof(Pro_surf_props));
memset(props,'\0',sizeof(Pro_surf_props));
prodb_get_surface_props(lPart,SEL_3D_PART, -1, 0,props);
int lColor = this->RGBToColor(props->color_rgb[0] * 255, props->color_rgb[1] * 255, props->color_rgb[2] * 255);
std::stringstream ss;
ss<< lColor << ",0,0,0,100,1";
return ss.str();
I faced with difficulties when getting geometry. I read Sect. "Core:
3D Geometry" and understood the structure of the part:
solid->Surface->Contur->Edge
However, I did not understand how to work with ProSolidSurfaceVisit
procedure and cannot find understandable examples of usage.
ProSolidSurfaceVisit procedure has three parameters.
I understood what the first parameter means:
ProError lStatus;
ProMdl lModel;
ProMdlType lModelType;
ProSurface **p_surfaces
lStatus = ProMdlCurrentGet(&lModel);
ProSolidSurfaceVisit((ProSolid)lModel, ?, ?,(ProAppData)&p_surfaces)
The second parameter:
Should I simply use ProAppData as the third parameter or work with contours?
Can I use NULL for the third parameter to get all surfaces?
Hello Vladimir,
sorry for the late reply, I was OOTO for two weeks.
The visit functions are a basic concept of Toolkit - they all work the same with the arguments 2 and 3 containing functions to be executed with all occurrences of the visited items. The sample codes linked from ProSolidSurfaceVisit() should give you an impression how to use the visit-actions.
To put it simple:
Regards,
Gunter
Hi Vladimir,
did you solve your problem with colors?
I need to retrive the current color of a part.
I tried with ProSurfaceAppearancepropsGet but on Part I retrive the part color
Using ProSurfaceAppearancepropsGet on Assy I retrive null data
Hope you can help!
Thanks Patrizia