Does OCC support importing an iges file's dimensioning?

If there are dimension lines and arrows in an iges file, does OCC ignore all that when importing/reading the file? I have an iges file with some dimension lines but they don't show up when I read the file in. According to iges.PDF section 2.2.1 Translatable Entities, it make no mention of dimensions so I'm assuming that they are just chucked out the window when importing. Please tell me I'm wrong, and there is a way to read all the dimension lines in along with the model. Thanks.

François Lauzon's picture

when you import an iges file, the dimension lines are read, you could access information about it but what is created by OCC is only brep entities (curves, surfaces, points,...) no dimensions. You have to do it yourself (have a look at the file IGESDimen.cdl).

You should search for others forum post that may help you with extracting IGESData_IGESEntity (which in your case some of them would be dimension, like IGESDimen_CenterLine, IGESDimen_LinearDimension and so on).

Good Luck,

K Rutherford's picture

Thanks Francois,

I appreciate your help in the right direction. I am now getting IGESDraw_View and IGESDimen_LinearDimension from the list after reading the file. Then, doing a TransferBRepEntity to convert them to a TopoDS_Shape and appending them my sequence of shapes to be displayed but I never see them. Have any ideas why they might not be displaying? Thanks again for you help, I appreciate it.


François Lauzon's picture

Yes, you can't convert them to BRep entities, it's not supported. You have to write your own converter for those entities. Basicly, only 3d objects are converted, all 2d and dimension stuff is not converted (it is read, so you can do something with it if you want). It make sense since there is not much high level api for the 2d like you could find for the 3d.

Look at section 2.4. Mapping of IGES entities to Open CASCADE shapes in the iges.pdf files for a list of iges entities that are converted to BRep entities, for all others entities, you have to do it yourself.

K Rutherford's picture


Thanks for your continuing input and help. I’ve made great strides in writing my own routines to building and drawing the dimensioning attributes in my iges files. However, I have one little squirrelly thing going on. If I create the iges file myself with a 3rd party app, and put in dimension lines and notes and I can display them properly now in OCC in the correct position. However, taking a file from someone else, that has dimension lines in it, it does draw the dimension attributes but the location it far out of whack. Any ideas? Do I need to check from some sort of translation or scaling on something? Just thought I would ask, you seem to be very knowledgeable about this.

Also, my next hurdle it to do the same thing for step files. Do I approach it the same way? I’ve been looking in the OCC Classes Browser and I’m not seeing anything like IGESDimen_???. What classes or packages would I use to extract dimensioning data from the step file? I see a StepDimTol_?? But it doesn’t show anything referring to leaderlines, arrowheads, or dimension lines.

Thanks again for you input.


PG's picture

Hello ( very late though),
can u share the implementation of a simple IGES file which contains geometry as
well as text to be imported using OCC API.
Also how to export similar dimensions to an IGEs file ?

- PG