@@ -68,7 +68,7 @@ protected void writeObject<T>(T co)
6868 this . writeScale ( scale ) ;
6969 break ;
7070 case SortEntitiesTable sortensTable :
71- // this.writeSortentsTable(sortensTable);
71+ this . writeSortentsTable ( sortensTable ) ;
7272 break ;
7373 case XRecord record :
7474 this . writeXRecord ( record ) ;
@@ -253,20 +253,15 @@ protected void writeMLineStyle(MLineStyle style)
253253
254254 private void writeSortentsTable ( SortEntitiesTable e )
255255 {
256- if ( e . BlockOwner == null )
257- {
258- //In some cases the block onwer is null in the files, this has to be checked
259- this . notify ( "SortEntitiesTable with handle {e.Handle} has no block owner" , NotificationType . Warning ) ;
260- return ;
261- }
256+ this . _writer . Write ( DxfCode . Subclass , DxfSubclassMarker . SortentsTable ) ;
262257
263- this . _writer . Write ( DxfCode . Start , e . ObjectName ) ;
258+ this . _writer . WriteHandle ( 330 , e . BlockOwner ) ;
264259
265- this . writeCommonObjectData ( e ) ;
266-
267- this . _writer . Write ( DxfCode . Subclass , DxfSubclassMarker . XRecord ) ;
268-
269- this . _writer . Write ( 330 , e . BlockOwner . Handle ) ;
260+ foreach ( SortEntitiesTable . Sorter item in e . Sorters )
261+ {
262+ this . _writer . WriteHandle ( 331 , item . Entity ) ;
263+ this . _writer . Write ( 5 , item . Handle ) ;
264+ }
270265 }
271266
272267 protected void writeXRecord ( XRecord e )
0 commit comments