How to get surface color after selection?
I am trying to get the color of surface after selecting it with a selection pointer as described in the toolkit user guide. It appears that the information resides wfcAppearance which is extracted from wfcWSelection.
pfcSelection_ptr selSurface = pfcCreateModelItemSelection(pfcModelItem::cast(surfaces->get(0)));
wfcWSelection_ptr wselSurface = wfcWSelection::cast(selSurface);
if (wselSurface->GetVisibleAppearance().isnull())
cout << "Error: wfcAppearance nullptr" << endl;
but GetVisibleAppearance() is returning a nullptr.
However, when I select a surface using user selection process by directly clicking on it after invoking session->select(), I am able to get wfcAppearance where i can access surface properties including its color.
Can anyone please help why is GetVisibleAppearance() returning nullptr from pfcSelection_ptr when selecting a surface programmatically using pfcCreateModelItemSelection() instead of clicking on it?
If there is any other way I will appreciate it as well. Thank you.
Creo 4.0 M150
Toolkit C++

