# dxflib 'How Do I' Questions

**URL:** http://forum.qcad.org/c/dxflib/dxflib-how-do-i-questions/35.md?page=1

[Latest](http://forum.qcad.org/latest.md) · [Categories](http://forum.qcad.org/categories.md) · [Tags](http://forum.qcad.org/tags.md)

**Page:** 2

---

## [Reading DXF: how to assign a line to a layer ?](http://forum.qcad.org/t/reading-dxf-how-to-assign-a-line-to-a-layer/1158)

<div class="topic-metadata">

**Author:** [@rekoru](http://forum.qcad.org/u/rekoru)\
**Replies:** 2\
**Last updated:** [June 24, 2013, 7:04pm UTC](http://forum.qcad.org/t/reading-dxf-how-to-assign-a-line-to-a-layer/1158 "2013-06-24T19:04:00Z")

</div>

I have a DXF file with lines assigned to several layers. I would like to determine a layer for each line object in a DXF file. As there is no layer info in DL\_LineData struct, I hoped to get the line-\>layer affiliation i…

---

## [DXF format querries..!!!](http://forum.qcad.org/t/dxf-format-querries/1106)

<div class="topic-metadata">

**Author:** [@rakeshthp](http://forum.qcad.org/u/rakeshthp)\
**Replies:** 4\
**Last updated:** [May 21, 2013, 11:10am UTC](http://forum.qcad.org/t/dxf-format-querries/1106 "2013-05-21T11:10:56Z")

</div>

I am trying to design and develop a DXF importer using C++. I have gone through the DXF references starting from version 2000 onwards. There are four things which have put the development on hold for me right now. Han…

---

## [Reading line type](http://forum.qcad.org/t/reading-line-type/928)

<div class="topic-metadata">

**Author:** [@AllanJ](http://forum.qcad.org/u/AllanJ)\
**Replies:** 3\
**Last updated:** [February 5, 2013, 12:36pm UTC](http://forum.qcad.org/t/reading-line-type/928 "2013-02-05T12:36:26Z")

</div>

I might be missing something, but I can’t see how to read LTYPE information. Looking at dll\_dxf.cpp, processDXFGroup() doesn’t include a check for “LTYPE”. I’m just about to upgrade to the latest version so I could use…

---

## [How to determine whether the file is 2D or 3D?](http://forum.qcad.org/t/how-to-determine-whether-the-file-is-2d-or-3d/980)

<div class="topic-metadata">

**Author:** [@Cambridge\_Ray](http://forum.qcad.org/u/Cambridge_Ray)\
**Replies:** 0\
**Last updated:** [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")

</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 insp…

---

## [How can a DXF file be validated?](http://forum.qcad.org/t/how-can-a-dxf-file-be-validated/979)

<div class="topic-metadata">

**Author:** [@Cambridge\_Ray](http://forum.qcad.org/u/Cambridge_Ray)\
**Replies:** 0\
**Last updated:** [November 23, 2012, 11:08pm UTC](http://forum.qcad.org/t/how-can-a-dxf-file-be-validated/979 "2012-11-23T23:08:41Z")

</div>

I am developing an application similar to the Windows Search. It performs a recursive search, looks for some items inside the DXF file and proceeds to the next. There may be hundreds or even thousands of files, so expedi…

---

## [How to just "modify" a DXF file?](http://forum.qcad.org/t/how-to-just-modify-a-dxf-file/976)

<div class="topic-metadata">

**Author:** [@jankungamba](http://forum.qcad.org/u/jankungamba)\
**Replies:** 3\
**Last updated:** [November 20, 2012, 4:11am UTC](http://forum.qcad.org/t/how-to-just-modify-a-dxf-file/976 "2012-11-20T04:11:53Z")

</div>

Hi guys, I’m currently doing a project that involves reading a DXF file and drawing its contents using openGL. The reading part is almost done since dxflib does all the parsing for me however the writing part seems that…

---

## [Some basic questions about DXF files](http://forum.qcad.org/t/some-basic-questions-about-dxf-files/975)

<div class="topic-metadata">

**Author:** [@Cambridge\_Ray](http://forum.qcad.org/u/Cambridge_Ray)\
**Replies:** 2\
**Last updated:** [November 17, 2012, 8:02pm UTC](http://forum.qcad.org/t/some-basic-questions-about-dxf-files/975 "2012-11-17T20:02:11Z")

</div>

I am attempting to develop a “dxf2pdf” application (I guess I don’t have to tell you what it does :slight\_smile: It is being written under Linux, but will eventually be ported to Windows. Note on my background: Luckily,…

---

## [How to retrieve the header properties of the DXF file?](http://forum.qcad.org/t/how-to-retrieve-the-header-properties-of-the-dxf-file/964)

<div class="topic-metadata">

**Author:** [@Cambridge\_Ray](http://forum.qcad.org/u/Cambridge_Ray)\
**Replies:** 4\
**Last updated:** [November 5, 2012, 7:59am UTC](http://forum.qcad.org/t/how-to-retrieve-the-header-properties-of-the-dxf-file/964 "2012-11-05T07:59:37Z")

</div>

I am referring to items like: AutoCAD Version ($ACADVER), etc. Those in Segment #1. TIA, -RFH

---

## [How do I retrieve a POLYLINE?](http://forum.qcad.org/t/how-do-i-retrieve-a-polyline/956)

<div class="topic-metadata">

**Author:** [@Cambridge\_Ray](http://forum.qcad.org/u/Cambridge_Ray)\
**Replies:** 1\
**Last updated:** [October 29, 2012, 4:08pm UTC](http://forum.qcad.org/t/how-do-i-retrieve-a-polyline/956 "2012-10-29T16:08:02Z")

</div>

In the example provided with the distro, they only show how to retrieve the flags. TIA, -Ray

---

## [Heights and locations of TEXT entities are being coupled](http://forum.qcad.org/t/heights-and-locations-of-text-entities-are-being-coupled/929)

<div class="topic-metadata">

**Author:** [@Cambridge\_Ray](http://forum.qcad.org/u/Cambridge_Ray)\
**Replies:** 1\
**Last updated:** [October 9, 2012, 8:54am UTC](http://forum.qcad.org/t/heights-and-locations-of-text-entities-are-being-coupled/929 "2012-10-09T08:54:15Z")

</div>

Question: Are the heights and locations of 2 AcDbText entities supposed to be coupled? QCAD doesn’t think so but a 3rd. party vendor says otherwise. How can I decouple them?? Another way to ask this question is this: In…

---

## [Compiling on RedHat Enterprise 6.2, gcc 4.4 ?](http://forum.qcad.org/t/compiling-on-redhat-enterprise-6-2-gcc-4-4/836)

<div class="topic-metadata">

**Author:** [@tpl](http://forum.qcad.org/u/tpl)\
**Replies:** 2\
**Last updated:** [July 6, 2012, 9:17am UTC](http://forum.qcad.org/t/compiling-on-redhat-enterprise-6-2-gcc-4-4/836 "2012-07-06T09:17:03Z")

</div>

Hi there, I will soon have to compile dxflib on a 64 bits RHEL 6.2 platform with gcc 4.4. Is it supported ? Do I have to know something special ? thank you

---

## [Reading only layers names: how do I stop parsing?](http://forum.qcad.org/t/reading-only-layers-names-how-do-i-stop-parsing/787)

<div class="topic-metadata">

**Author:** [@diego.gnesi](http://forum.qcad.org/u/diego.gnesi)\
**Replies:** 1\
**Last updated:** [May 21, 2012, 3:12pm UTC](http://forum.qcad.org/t/reading-only-layers-names-how-do-i-stop-parsing/787 "2012-05-21T15:12:48Z")

</div>

I inherited a class from DL\_CreationAdapter for extracting layer names from a dxf file. The problem is that the code is VERY slow, because the DL\_CreationAdapter correctly reads all layers but then contnues to read the f…

---

## [How do I write DXF text to stdout?](http://forum.qcad.org/t/how-do-i-write-dxf-text-to-stdout/729)

<div class="topic-metadata">

**Author:** [@chainichek](http://forum.qcad.org/u/chainichek)\
**Replies:** 5\
**Last updated:** [April 3, 2012, 9:54am UTC](http://forum.qcad.org/t/how-do-i-write-dxf-text-to-stdout/729 "2012-04-03T09:54:28Z")

</div>

I use DL\_WriterA to write DXF text to some.dxf file. Is there any way to redirect DXF text to stdout?

---

## [Writing dimensions in a dxf file using dxflib](http://forum.qcad.org/t/writing-dimensions-in-a-dxf-file-using-dxflib/572)

<div class="topic-metadata">

**Author:** [@Frank\_Marijsse](http://forum.qcad.org/u/Frank_Marijsse)\
**Replies:** 1\
**Last updated:** [November 8, 2011, 1:55pm UTC](http://forum.qcad.org/t/writing-dimensions-in-a-dxf-file-using-dxflib/572 "2011-11-08T13:55:49Z")

</div>

I don’t succeed to write dimensions in a dxf file that can be imported in AutoCAD 2010. I have written a dimension style with writeDimStyle() and a linear dimension entity with writeDimLinear(). AutoCAD imports the file…

---

## [Get length of polyline](http://forum.qcad.org/t/get-length-of-polyline/456)

<div class="topic-metadata">

**Author:** [@Tomtefar](http://forum.qcad.org/u/Tomtefar)\
**Replies:** 1\
**Last updated:** [March 23, 2011, 8:59pm UTC](http://forum.qcad.org/t/get-length-of-polyline/456 "2011-03-23T20:59:43Z")

</div>

Is there a magical way to get the total length of a polyline? It has to work with rounded corners. I only have one polyline per layer if that makes it easier. At the moment I use normal lines which I calculate the tota…

---

## [How to draw text with the dxf-\>writeText()](http://forum.qcad.org/t/how-to-draw-text-with-the-dxf-writetext/443)

<div class="topic-metadata">

**Author:** [@Oleg](http://forum.qcad.org/u/Oleg)\
**Replies:** 0\
**Last updated:** [January 13, 2011, 2:04pm UTC](http://forum.qcad.org/t/how-to-draw-text-with-the-dxf-writetext/443 "2011-01-13T14:04:28Z")

</div>

Hello! I have a question. How to use dxf-\>writeText(…) In \*.dxf file I draw only one text string with dxf-\>writeText() AutoCad (2000, 2002, 2004, 2005) error: AutoCad 2005 The following error was encountered while …

---

## [How do I read drawing extents](http://forum.qcad.org/t/how-do-i-read-drawing-extents/429)

<div class="topic-metadata">

**Author:** [@dgp](http://forum.qcad.org/u/dgp)\
**Replies:** 4\
**Last updated:** [November 11, 2010, 9:30am UTC](http://forum.qcad.org/t/how-do-i-read-drawing-extents/429 "2010-11-11T09:30:42Z")

</div>

Hi,I have a dxf file with the below extents in the header section. How do I read them using dxflib ? $LIMMIN 10 -122.3180704378 20 47.4300256966 9 $LIMMAX 10 -122.3078004390 20 47.4643399154

---

## [Pass Version Number to my Class](http://forum.qcad.org/t/pass-version-number-to-my-class/90)

<div class="topic-metadata">

**Author:** [@pricecreations](http://forum.qcad.org/u/pricecreations)\
**Replies:** 4\
**Last updated:** [November 11, 2010, 6:27am UTC](http://forum.qcad.org/t/pass-version-number-to-my-class/90 "2010-11-11T06:27:22Z")

</div>

I am trying to pass the version number to my Test\_CreationClass so that I can check to see what version of AutoCAD the dxf file was created in to do my own error handling. Does anyone know how I would go about doing thi…

---

## [Block insert](http://forum.qcad.org/t/block-insert/420)

<div class="topic-metadata">

**Author:** [@sekigawa](http://forum.qcad.org/u/sekigawa)\
**Replies:** 0\
**Last updated:** [September 25, 2010, 6:41am UTC](http://forum.qcad.org/t/block-insert/420 "2010-09-25T06:41:43Z")

</div>

Hello, I want to join two existing DXF files (say, “no1.dxf” and “no2.dxf”) to create a new one (say, “no3.dxf”) by “block insertion.” In the simplest case, only one instance of “no1.dxf” and “no2.dxf” are inserted i…

---

## [How to write Polygon with DXFLIB ?](http://forum.qcad.org/t/how-to-write-polygon-with-dxflib/385)

<div class="topic-metadata">

**Author:** [@Davidow](http://forum.qcad.org/u/Davidow)\
**Replies:** 15\
**Last updated:** [May 28, 2010, 1:15pm UTC](http://forum.qcad.org/t/how-to-write-polygon-with-dxflib/385 "2010-05-28T13:15:17Z")

</div>

Hello, Can you help me please. I’m trying to create polygon with dxflib. But unfortunately it does not work: ( Maybe you have an outtake from the Sourse code?

---

## [Re-entrant polygons/embedded polygon](http://forum.qcad.org/t/re-entrant-polygons-embedded-polygon/369)

<div class="topic-metadata">

**Author:** [@jjq](http://forum.qcad.org/u/jjq)\
**Replies:** 2\
**Last updated:** [March 23, 2010, 7:41pm UTC](http://forum.qcad.org/t/re-entrant-polygons-embedded-polygon/369 "2010-03-23T19:41:44Z")

</div>

Hello, We are evaluating DXFLIB. DXF files with embedded polygons seems to show up just fine in QCAD. However, there seems to be an issue handling such polygons when using DXFLIB. See the attached picture. The first i…

---

## [Qcad 2010](http://forum.qcad.org/t/qcad-2010/358)

<div class="topic-metadata">

**Author:** [@jamesarbrown](http://forum.qcad.org/u/jamesarbrown)\
**Replies:** 1\
**Last updated:** [February 15, 2010, 1:33pm UTC](http://forum.qcad.org/t/qcad-2010/358 "2010-02-15T13:33:19Z")

</div>

Hi Andrew, 1/ When will QCAD 3 prof 2010 be released? We are encountering more and more difficulty dropping new dwg back to the old DXF2000 format (using ACME cad convert) and maybe DXF2007 may help fix this. Infact …

---

## [How to read lines width for DXF curves?](http://forum.qcad.org/t/how-to-read-lines-width-for-dxf-curves/273)

<div class="topic-metadata">

**Author:** [@m\_alexm](http://forum.qcad.org/u/m_alexm)\
**Replies:** 4\
**Last updated:** [December 4, 2009, 4:37pm UTC](http://forum.qcad.org/t/how-to-read-lines-width-for-dxf-curves/273 "2009-12-04T16:37:35Z")

</div>

Hello, I wanted to retrieve the lines width (Stroke dimension cf. Adobe Illustrator) for DXF curves, but I didn’t succeed. Is it possible with dxflib library? More details: I created a DXF file containing 2 curves with…

---

## [DXF format](http://forum.qcad.org/t/dxf-format/343)

<div class="topic-metadata">

**Author:** [@IRENKA](http://forum.qcad.org/u/IRENKA)\
**Replies:** 4\
**Last updated:** [December 4, 2009, 3:49pm UTC](http://forum.qcad.org/t/dxf-format/343 "2009-12-04T15:49:21Z")

</div>

What dxf formats can accept Qcad today? DXF 2004, 2007…? Thanks

---

## [Drawing a random object](http://forum.qcad.org/t/drawing-a-random-object/223)

<div class="topic-metadata">

**Author:** [@laser](http://forum.qcad.org/u/laser)\
**Replies:** 9\
**Last updated:** [September 18, 2009, 9:22am UTC](http://forum.qcad.org/t/drawing-a-random-object/223 "2009-09-18T09:22:18Z")

</div>

Hi, I’ve just begun using this library. Starting with your example, I can draw straight lines and points. However, with a given set of points, what function do I have to use if I want to connect them ? I thought about…

---

## [Break up a large DXF into small DXFs?](http://forum.qcad.org/t/break-up-a-large-dxf-into-small-dxfs/300)

<div class="topic-metadata">

**Author:** [@amhoov](http://forum.qcad.org/u/amhoov)\
**Replies:** 1\
**Last updated:** [August 20, 2009, 2:43am UTC](http://forum.qcad.org/t/break-up-a-large-dxf-into-small-dxfs/300 "2009-08-20T02:43:56Z")

</div>

I’m working with a laser, the software for which can import DXF files for cutting. However, the cutting field of the laser is smaller than the size of the drawing. I’d like to be able to break a large DXF up into smalle…

---

## [Read Unicode files](http://forum.qcad.org/t/read-unicode-files/291)

<div class="topic-metadata">

**Author:** [@Kranzl](http://forum.qcad.org/u/Kranzl)\
**Replies:** 1\
**Last updated:** [June 10, 2009, 1:21pm UTC](http://forum.qcad.org/t/read-unicode-files/291 "2009-06-10T13:21:24Z")

</div>

Hello! Can I use dxf library to read DXF files which contain unicode texts or element names? Thanks.

---

## [inserting blocks ...how?!](http://forum.qcad.org/t/inserting-blocks-how/289)

<div class="topic-metadata">

**Author:** [@bonsalty](http://forum.qcad.org/u/bonsalty)\
**Replies:** 1\
**Last updated:** [June 9, 2009, 2:30pm UTC](http://forum.qcad.org/t/inserting-blocks-how/289 "2009-06-09T14:30:33Z")

</div>

I added in the block section dxf-\>writeBlock(\*dw, DL\_BlockData(“myblock”, 0, 3.0, 3.0, 0.0)); dxf-\>writeLine(…); dxf-\>writeCircle(…); … other entities … dxf-\>writeEndBlock(\*dw, “myblock”); Till this point its cle…

---

## [How to obtain the real / original colors of DXF entities?](http://forum.qcad.org/t/how-to-obtain-the-real-original-colors-of-dxf-entities/274)

<div class="topic-metadata">

**Author:** [@m\_alexm](http://forum.qcad.org/u/m_alexm)\
**Replies:** 1\
**Last updated:** [April 28, 2009, 4:52pm UTC](http://forum.qcad.org/t/how-to-obtain-the-real-original-colors-of-dxf-entities/274 "2009-04-28T16:52:18Z")

</div>

Hello, Using dxflib library, I observed that the colors of DXF entities are referenced by a 256 color palette entries (dxfColors\[3\] → Extended color palette). Is it possible to retrieve the original RGB values of each D…

---

## [dxf image file](http://forum.qcad.org/t/dxf-image-file/193)

<div class="topic-metadata">

**Author:** [@darths](http://forum.qcad.org/u/darths)\
**Replies:** 1\
**Last updated:** [September 10, 2008, 7:10am UTC](http://forum.qcad.org/t/dxf-image-file/193 "2008-09-10T07:10:18Z")

</div>

I hope this isn’t a dumb question - don’t see it answered anywhere: is it possible to obtain an image file (jpeg or something) from a dxf file using dxflib? Thanks!

[Previous page](http://forum.qcad.org/c/dxflib/dxflib-how-do-i-questions/35.md)

[Next page](http://forum.qcad.org/c/dxflib/dxflib-how-do-i-questions/35.md?page=2)
