For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

About XDE

gpsunjp's picture
Forums: 

I use the following code to read a iges file.
But I cannot retrieve any shapes from shapeTool.

Could anyone know how to use IGESCAFControl_Reader ?

Thank you in advance!

===================================================

Handle(TDocStd_Document) doc;
Handle(TDocStd_Application) A;
if (!DDocStd::Find(A)) {cout A->NewDocument("MDTV-XCAF",doc);
TDataStd_Name::Set(doc->GetData()->Root(),"SGP");

IGESCAFControl_Reader igesReader;

igesReader.SetColorMode (Standard_True);
igesReader.SetNameMode (Standard_True);
igesReader.SetLayerMode (Standard_True);;
IFSelect_ReturnStatus readStat = igesReader.ReadFile("c:\\temp\\BoxTrim.igs");
if(!igesReader.Transfer(doc))
{
cout }

Handle(XCAFDoc_ShapeTool) shapeTool = XCAFDoc_DocumentTool::ShapeTool(doc->Main());

Patrik Mueller's picture

Hi,

assuming the reading itself was successfull, have you tried it with the "GetShape" methods from XCAFDoc_ShapeTool?

Regards,

Patrik

gpsunjp's picture

Hi,

I got shapes using GetShapes().

Thank You very much.

Jansen's picture

How to get color of the shape from iges file with XDE?