Mon, 03/03/2014 - 18:52
Hello, I try to retrieve information during step import (name, color,..). Starting from IESample, I have found a way to analyse the AIS_InteractiveContext after importation (list of shape with relations) but I did not find the way for retrieving name and color information.
Tue, 10/15/2019 - 09:21
you can try like this :
Handle(TDocStd_Document) aDoc;
Handle(XCAFApp_Application) anApp = XCAFApp_Application::GetApplication();
anApp->NewDocument("MDTV-XCAF", aDoc);
STEPCAFControl_Reader aStepReader;
aStepReader.SetColorMode(true);
aStepReader.SetNameMode(true);
aStepReader.SetLayerMode(true);
aStepReader.ReadFile(theStepName);
aStepReader.Transfer(aDoc);
TDF_Label aRootLabel = aDoc->Main();
aShapeTool = XCAFDoc_DocumentTool::ShapeTool(aRootLabel);
aColorTool = XCAFDoc_DocumentTool::ColorTool(aRootLabel);
/*TDF_LabelSequence colors,shapes,layers;
aColorTool->GetColors(colors);
aShapeTool->GetShapes(shapes);
you will get colors infomation, but cannot know which face the color on. I am trying hard to get the color on the relative surface.