This project has moved. For the latest updates, please go here.

processing arc entities in blocks

Aug 7, 2015 at 8:12 AM
how to find the absolute coordinate of the arc center with the insert information, can anyboy give me a fomula to calculate? thanks.
Aug 7, 2015 at 7:03 PM
Check the Insert entity class, under the "Explode" region there is some commented code that might help you.

Aug 8, 2015 at 1:19 AM
Now I'm using C++ to read and show dxf files, I have no trouble to read dxf files, but there is some problem in showing them, especially blocks. I see in your code the Insert has 210, 220, 230 group code, but When I check my dxf file(version 2010), there is no such group code in Insert, and you use this information in transformation matrix, so could you give me some hint of your code, thanks very much!
Aug 8, 2015 at 1:56 AM
and I found that the scale value would be negative, for example in my dxf file one block with arc entity, the Insert scalex = -1200, and scaley = 1200, so I am a little confused , how can scale be negative?
Aug 8, 2015 at 2:46 AM
By the way, could you give me your e-mail address or any other you like, so I can send you my dxf file, and check if you can show the file correctly, I used your "explode" code in my project, but the result was also not correct, Thanks.
Aug 9, 2015 at 6:42 PM
One answer at a time:
  1. The 210, 220, and 230 codes represents the normal of an entity, when omitted the default (0,0,1) vector is used instead.
  2. A negative scale value represents a symmetry in that axis.
  3. You can find my email address at the head of every source code file. If your dxf file loads without errors what you do after that is outside the scope of this library, and your responsibility.
You should use that explode code as a guide, it is far from finished and it is not guaranteed to work under all circumstances. For example, since you are interested in arc entities if the insert scale is not uniform it will become an ellipse arc, and if the scale vector has negative components the start and end angles will change. Try to pinpoint the problem starting with a basic sample, a block with a single arc, and insert it in your drawing, then start to change its rotation, its scale, and its normal one at a time, to find out what it going wrong.

Marked as answer by Phymin on 8/9/2015 at 5:18 PM