# How to determine whether the file is 2D or 3D?

**URL:** <http://forum.qcad.org/t/how-to-determine-whether-the-file-is-2d-or-3d/980>\
**Category:** dxflib 'How Do I' Questions\
**Created:** [November 23, 2012, 11:17pm UTC](http://forum.qcad.org/t/how-to-determine-whether-the-file-is-2d-or-3d/980 "2012-11-23T23:17:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cambridge\_Ray](http://forum.qcad.org/letter_avatar_proxy/v4/letter/c/90ced4/32.png) [@Cambridge\_Ray](http://forum.qcad.org/u/Cambridge_Ray)\
**Post date:** [November 23, 2012, 11:17pm UTC](http://forum.qcad.org/t/how-to-determine-whether-the-file-is-2d-or-3d/980/1 "2012-11-23T23:17:46Z")

</div>

What I would like to code is this:

I enter the DXF file, and as soon as I find the first line segment that contains a non-zero Z value, I return: “This is a 3D file”. I am even willing to return a “2D” answer after inspecting the first dozen points or so.

Given the callback architecture of the library (or my newbieness) what I have is a counter of non-zero Z points. This approach can be excruciatingly slow, specially when dealing with a large number of files.

TIA,

-RFH
