[solved] Create dxf file with splines in an external application

Drop in here to discuss whatever you want.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
RainerP
Junior Member
Posts: 11
Joined: Tue Feb 09, 2021 5:38 pm

[solved] Create dxf file with splines in an external application

Post by RainerP » Thu Feb 10, 2022 1:21 pm

Hello Together,

I am on developing an airfoil manager. To use the airfoils in qcad, i implement an dxf export.

The airfoil can exported as:
- Lines
- Poligonline
- Spline

Now i try to export two Splines to the dxf file.
One spline for the top side, one line for the bottom side.
Additional i try to export one line as the airfoil chord.

Unfortunately, only the bottom line is displayed, if i open the file in QCad.
Has anyone a little bit mor knowledge about dxf files and can help me?

Also i like to minimize the header.

Attached files:
DXF_Header
DxfHeader13.txt
(28.48 KiB) Downloaded 282 times
dxf file with 2 Splines

Thank you and BR
Rainer

p.s. OS Windows or MAC, QCAD Professional V3.27
Last edited by RainerP on Thu Feb 10, 2022 4:20 pm, edited 1 time in total.

User avatar
andrew
Site Admin
Posts: 9019
Joined: Fri Mar 30, 2007 6:07 am

Re: Create dxf file with splines in an external application

Post by andrew » Thu Feb 10, 2022 3:50 pm

I can confirm that the file "A 18_2Splines.dxf" contains exactly one spline entity (i.e. one "SPLINE" entry in section "ENTITIES").

RainerP
Junior Member
Posts: 11
Joined: Tue Feb 09, 2021 5:38 pm

Re: Create dxf file with splines in an external application

Post by RainerP » Thu Feb 10, 2022 4:19 pm

Hello Andrew,

sorry i have attached the wrong file.
This is the correct file :
A 18_2Splines.dxf
(32.53 KiB) Downloaded 288 times
Thank you and BR
Rainer

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4931
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: Create dxf file with splines in an external application

Post by Husky » Thu Feb 10, 2022 7:52 pm

RainerP wrote:
Thu Feb 10, 2022 4:19 pm
sorry i have attached the wrong file.
This is the correct file : A 18_2Splines.dxf
The new file shows two splines. One zero length and one which is 201.33970578 in length. No units used.
Attachments
Husky-2022.02.10-01.png
Husky-2022.02.10-01.png (8.01 KiB) Viewed 5514 times
Work smart, not hard: QCad Pro
Win10/64, QcadPro, QcadCam version: Current.
If a thread is considered as "solved" please change the title of the first post to "[solved] Title..."

CVH
Premier Member
Posts: 3364
Joined: Wed Sep 27, 2017 4:17 pm

Re: Create dxf file with splines in an external application

Post by CVH » Fri Feb 11, 2022 7:10 am

Correction:
1 Spline + 1 zero length line.

Before saving that could have been a Null-Line entity.
Only selectable with TA.
On reload those pop up as zero length lines at the origin angled 0 degrees.

Regards,
CVH

RainerP
Junior Member
Posts: 11
Joined: Tue Feb 09, 2021 5:38 pm

Re: Create dxf file with splines in an external application

Post by RainerP » Fri Feb 11, 2022 9:53 am

Hello Together,

In the file should be two Splines and one Line.
Unit should be mm.

First Spline starts on line 3948
Second Spline starts on line 4228
The Line starts on line 4508 ans should be from 0,0 to 200,0

LINE
8
0
10
0.000000
20
0.000000
30
0.000000
11
200.000000
21
0.000000
31
0.000000

What is wrong in the dxf file, that only the second spline is displayed and the line has the wrong length?

Thank you and BR
Rainer

User avatar
andrew
Site Admin
Posts: 9019
Joined: Fri Mar 30, 2007 6:07 am

Re: Create dxf file with splines in an external application

Post by andrew » Fri Feb 11, 2022 11:53 am

A couple of things:
- the file has multiple ENTITIES section for each entity (not sure if this is allowed, certainly not common)
- In the chosen revision of DXF, LINE needs DB entries:

Code: Select all

100
AcDbEntity
100
AcDbLine
- Both splines use the same handle (ID) which would explain that only one is imported:

Code: Select all

  5
38

CVH
Premier Member
Posts: 3364
Joined: Wed Sep 27, 2017 4:17 pm

Re: Create dxf file with splines in an external application

Post by CVH » Fri Feb 11, 2022 11:55 am

RainerP wrote:
Fri Feb 11, 2022 9:53 am
What is wrong in the dxf file, that only the second spline is displayed and the line has the wrong length?
I am not a specialist in this but this is how a line (0,0,0) - (0,200,0) looks like exported by QCAD in R13 dxf:

Code: Select all

SECTION
  2
ENTITIES
  0
LINE
  5
39
330
279
100
AcDbEntity
  8
0
100
AcDbLine
 10
0.0
 20
0.0
 30
0.0
 11
200.0
 21
0.0
 31
0.0
  0
Further, if I export 2 random fitpoint spline there is no termination of the section between them:

Code: Select all

ENDSEC
  0
SECTION
  2
ENTITIES
  0
I can copy both of the splines sections textual to the test file with the line ... :wink:
... one by one. But I didn't manage to include both at the same time. :(
With copy/paste under QCAD from 2 trials to a new drawing file I get:
A 18_2Splines_v2CVH.dxf
(65.96 KiB) Downloaded 289 times

Regards,
CVH

RainerP
Junior Member
Posts: 11
Joined: Tue Feb 09, 2021 5:38 pm

Re: Create dxf file with splines in an external application

Post by RainerP » Fri Feb 11, 2022 3:28 pm

Hello together,

thank you for your Help!
With the Info from Andrew, i could fix my probelm!
A 18_2Splines.dxf
(32.49 KiB) Downloaded 293 times
Thank you an have a nice weekend!

BR
Rainer

Post Reply

Return to “Chat”