Skip to content

Commit 485d7a0

Browse files
committed
dxf export: link vertices to polyline (fixes #15484)
(cherry picked from commit 052d3ef)
1 parent d477d19 commit 485d7a0

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

src/core/dxf/qgsdxfexport.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,12 @@ void QgsDxfExport::writeGroup( const QColor& color, int exactMatchCode, int rgbC
451451
minDist = dist;
452452
}
453453

454-
if ( minDist == 0 && color.alpha() == 255 && minDistAt != 7 )
454+
if ( minDist == 0 && minDistAt != 7 )
455455
{
456456
// exact full opaque match, not black/white
457457
writeGroup( exactMatchCode, minDistAt );
458-
return;
458+
if ( color.alpha() == 255 )
459+
return;
459460
}
460461

461462
int c = ( color.red() & 0xff ) * 0x10000 + ( color.green() & 0xff ) * 0x100 + ( color.blue() & 0xff );
@@ -3437,21 +3438,24 @@ void QgsDxfExport::writePolyline( const QgsPointSequence &line, const QString& l
34373438
else
34383439
{
34393440
writeGroup( 0, "POLYLINE" );
3440-
writeHandle();
3441-
writeGroup( 8, layer );
3441+
int plHandle = writeHandle();
3442+
writeGroup( 330, mBlockHandle );
34423443
writeGroup( 100, "AcDbEntity" );
3443-
writeGroup( 100, "AcDb3dPolyline" );
3444+
writeGroup( 8, layer );
34443445
writeGroup( 6, lineStyleName );
3445-
writeGroup( 0, QgsPointV2( QgsWkbTypes::PointZ ) );
34463446
writeGroup( color );
3447+
writeGroup( 100, "AcDb3dPolyline" );
3448+
writeGroup( 0, QgsPointV2( QgsWkbTypes::PointZ ) );
34473449
writeGroup( 70, 8 );
34483450

34493451
for ( int i = 0; i < n; i++ )
34503452
{
34513453
writeGroup( 0, "VERTEX" );
34523454
writeHandle();
3453-
writeGroup( 8, layer );
3455+
writeGroup( 330, plHandle );
34543456
writeGroup( 100, "AcDbEntity" );
3457+
writeGroup( 8, layer );
3458+
writeGroup( color );
34553459
writeGroup( 100, "AcDbVertex" );
34563460
writeGroup( 100, "AcDb3dPolylineVertex" );
34573461
writeGroup( 0, line[i] );
@@ -3460,8 +3464,10 @@ void QgsDxfExport::writePolyline( const QgsPointSequence &line, const QString& l
34603464

34613465
writeGroup( 0, "SEQEND" );
34623466
writeHandle();
3463-
writeGroup( 8, layer );
3467+
writeGroup( 330, plHandle );
34643468
writeGroup( 100, "AcDbEntity" );
3469+
writeGroup( 8, layer );
3470+
writeGroup( color );
34653471
}
34663472
}
34673473

0 commit comments

Comments
 (0)