@@ -1054,10 +1054,6 @@ private CadTemplate readUnlistedType(short classNumber)
10541054 template = this . readMultiLeader ( ) ;
10551055 break ;
10561056 case "MLEADERSTYLE" :
1057- if ( ! this . R2010Plus ) {
1058- this . notify ( $ "MLEADERSTYLE is not supported for { this . _version } .", NotificationType . Warning ) ;
1059- return null ;
1060- }
10611057 template = this . readMultiLeaderStyle ( ) ;
10621058 break ;
10631059 case "PDFDEFINITION" :
@@ -3129,12 +3125,14 @@ private CadTemplate readMultiLeader()
31293125 // Multileader Common data
31303126 // 340 Leader StyleId (handle)
31313127 template . LeaderStyleHandle = this . handleReference ( ) ;
3128+
31323129 //BL 90 Property Override Flags (int32)
31333130 mLeader . PropertyOverrideFlags = ( MultiLeaderPropertyOverrideFlags ) this . _objectReader . ReadBitLong ( ) ;
31343131 //BS 170 LeaderLineType (short)
31353132 mLeader . PathType = ( MultiLeaderPathType ) this . _objectReader . ReadBitShort ( ) ;
31363133 //CMC 91 Leade LineColor (Color)
31373134 mLeader . LineColor = this . _mergedReaders . ReadCmColor ( ) ;
3135+
31383136 //H 341 LeaderLineTypeID (handle/LineType)
31393137 template . LeaderLineTypeHandle = this . handleReference ( ) ;
31403138
@@ -3144,23 +3142,25 @@ private CadTemplate readMultiLeader()
31443142 mLeader . EnableLanding = this . _objectReader . ReadBit ( ) ;
31453143 //B 291 Enable Dogleg
31463144 mLeader . EnableDogleg = this . _objectReader . ReadBit ( ) ;
3147-
31483145 // 41 Dogleg Length / Landing distance
31493146 mLeader . LandingDistance = this . _objectReader . ReadBitDouble ( ) ;
3147+
31503148 // 342 Arrowhead ID
31513149 template . ArrowheadHandle = this . handleReference ( ) ;
31523150
31533151 // 42 Arrowhead Size
31543152 mLeader . ArrowheadSize = this . _objectReader . ReadBitDouble ( ) ;
31553153 //BS 172 Content Type
31563154 mLeader . ContentType = ( LeaderContentType ) this . _objectReader . ReadBitShort ( ) ;
3155+
31573156 //H 343 Text Style ID (handle/TextStyle)
31583157 template . MTextStyleHandle = this . handleReference ( ) ;
31593158
31603159 // 173 Text Left Attachment Type
31613160 mLeader . TextLeftAttachment = ( TextAttachmentType ) this . _objectReader . ReadBitShort ( ) ;
31623161 // 95 Text Right Attachment Type
31633162 mLeader . TextRightAttachment = ( TextAttachmentType ) this . _objectReader . ReadBitShort ( ) ;
3163+
31643164 // 174 Text Angle Type
31653165 mLeader . TextAngle = ( TextAngleType ) this . _objectReader . ReadBitShort ( ) ;
31663166 // 175 Text Alignment Type
@@ -3523,8 +3523,11 @@ private CadTemplate readMultiLeaderStyle()
35233523
35243524 this . readCommonNonEntityData ( template ) ;
35253525
3526- // BS 179 Version expected: 2
3527- var version = this . _objectReader . ReadBitShort ( ) ;
3526+ if ( this . R2010Plus )
3527+ {
3528+ // BS 179 Version expected: 2
3529+ var version = this . _objectReader . ReadBitShort ( ) ;
3530+ }
35283531
35293532 // BS 170 Content type (see paragraph on LEADER for more details).
35303533 mLeaderStyle . ContentType = ( LeaderContentType ) this . _objectReader . ReadBitShort ( ) ;
@@ -3533,7 +3536,7 @@ private CadTemplate readMultiLeaderStyle()
35333536 // BS 172 Draw leader order (0 = draw leader head first, 1 = draw leader tail first)
35343537 mLeaderStyle . LeaderDrawOrder = ( LeaderDrawOrderType ) this . _objectReader . ReadBitShort ( ) ;
35353538 // BL 90 Maximum number of points for leader
3536- mLeaderStyle . MaxLeaderSegmentsPoints = this . _objectReader . ReadBitShort ( ) ;
3539+ mLeaderStyle . MaxLeaderSegmentsPoints = this . _objectReader . ReadBitLong ( ) ;
35373540 // BD 40 First segment angle (radians)
35383541 mLeaderStyle . FirstSegmentAngleConstraint = this . _objectReader . ReadBitDouble ( ) ;
35393542 // BD 41 Second segment angle (radians)
@@ -3542,8 +3545,10 @@ private CadTemplate readMultiLeaderStyle()
35423545 mLeaderStyle . PathType = ( MultiLeaderPathType ) this . _objectReader . ReadBitShort ( ) ;
35433546 // CMC 91 Leader line color
35443547 mLeaderStyle . LineColor = this . _mergedReaders . ReadCmColor ( ) ;
3548+
35453549 // H 340 Leader line type handle (hard pointer)
35463550 template . LeaderLineTypeHandle = this . handleReference ( ) ;
3551+
35473552 // BL 92 Leader line weight
35483553 mLeaderStyle . LeaderLineWeight = ( LineweightType ) this . _objectReader . ReadBitLong ( ) ;
35493554 // B 290 Is landing enabled?
@@ -3556,41 +3561,40 @@ private CadTemplate readMultiLeaderStyle()
35563561 mLeaderStyle . LandingDistance = this . _objectReader . ReadBitDouble ( ) ;
35573562 // TV 3 Style description
35583563 mLeaderStyle . Description = this . _mergedReaders . ReadVariableText ( ) ;
3564+
35593565 // H 341 Arrow head block handle (hard pointer)
35603566 template . ArrowheadHandle = this . handleReference ( ) ;
3567+
35613568 // BD 44 Arrow head size
35623569 mLeaderStyle . ArrowheadSize = this . _objectReader . ReadBitDouble ( ) ;
35633570 // TV 300 Text default
35643571 mLeaderStyle . DefaultTextContents = this . _mergedReaders . ReadVariableText ( ) ;
3572+
35653573 // H 342 Text style handle (hard pointer)
35663574 template . MTextStyleHandle = this . handleReference ( ) ;
3575+
35673576 // BS 174 Left attachment (see paragraph on LEADER for more details).
35683577 mLeaderStyle . TextLeftAttachment = ( TextAttachmentType ) this . _objectReader . ReadBitShort ( ) ;
35693578 // BS 178 Right attachment (see paragraph on LEADER for more details).
35703579 mLeaderStyle . TextRightAttachment = ( TextAttachmentType ) this . _objectReader . ReadBitShort ( ) ;
3571- if ( this . R2010Plus )
3572- { // IF IsNewFormat OR DXF file
3573- // BS 175 Text angle type (see paragraph on LEADER for more details).
3574- mLeaderStyle . TextAngle = ( TextAngleType ) this . _objectReader . ReadBitShort ( ) ;
3575-
3576- } // END IF IsNewFormat OR DXF file
3577- // BS 176 Text alignment type
3580+ // BS 175 Text angle type (see paragraph on LEADER for more details).
3581+ mLeaderStyle . TextAngle = ( TextAngleType ) this . _objectReader . ReadBitShort ( ) ;
3582+ // BS 176 Text alignment type
35783583 mLeaderStyle . TextAlignment = ( TextAlignmentType ) this . _objectReader . ReadBitShort ( ) ;
35793584 // CMC 93 Text color
35803585 mLeaderStyle . TextColor = this . _mergedReaders . ReadCmColor ( ) ;
35813586 // BD 45 Text height
35823587 mLeaderStyle . TextHeight = this . _objectReader . ReadBitDouble ( ) ;
35833588 // B 292 Text frame enabled
35843589 mLeaderStyle . TextFrame = this . _objectReader . ReadBit ( ) ;
3585- if ( this . R2010Plus )
3586- { // IF IsNewFormat OR DXF file
3587- // B 297 Always align text left
3588- mLeaderStyle . TextAlignAlwaysLeft = this . _objectReader . ReadBit ( ) ;
3589- } // END IF IsNewFormat OR DXF file
3590- // BD 46 Align space
3590+ // B 297 Always align text left
3591+ mLeaderStyle . TextAlignAlwaysLeft = this . _objectReader . ReadBit ( ) ;
3592+ // BD 46 Align space
35913593 mLeaderStyle . AlignSpace = this . _objectReader . ReadBitDouble ( ) ;
3594+
35923595 // H 343 Block handle (hard pointer)
35933596 template . BlockContentHandle = this . handleReference ( ) ;
3597+
35943598 // CMC 94 Block color
35953599 mLeaderStyle . BlockContentColor = this . _mergedReaders . ReadCmColor ( ) ;
35963600 // 3BD 47,49,140 Block scale vector
@@ -3615,15 +3619,21 @@ private CadTemplate readMultiLeaderStyle()
36153619 // BD 143 Break size
36163620 mLeaderStyle . BreakGapSize = this . _objectReader . ReadBitDouble ( ) ;
36173621
3618- // BS 271 Attachment direction (see paragraph on LEADER for more details).
3619- mLeaderStyle . TextAttachmentDirection = ( TextAttachmentDirectionType ) this . _objectReader . ReadBitShort ( ) ;
3620- // BS 273 Top attachment (see paragraph on LEADER for more details).
3621- mLeaderStyle . TextBottomAttachment = ( TextAttachmentType ) this . _objectReader . ReadBitShort ( ) ;
3622- // BS 272 Bottom attachment (see paragraph on LEADER for more details).
3623- mLeaderStyle . TextTopAttachment = ( TextAttachmentType ) this . _objectReader . ReadBitShort ( ) ;
3622+ if ( this . R2010Plus )
3623+ {
3624+ // BS 271 Attachment direction (see paragraph on LEADER for more details).
3625+ mLeaderStyle . TextAttachmentDirection = ( TextAttachmentDirectionType ) this . _objectReader . ReadBitShort ( ) ;
3626+ // BS 273 Top attachment (see paragraph on LEADER for more details).
3627+ mLeaderStyle . TextBottomAttachment = ( TextAttachmentType ) this . _objectReader . ReadBitShort ( ) ;
3628+ // BS 272 Bottom attachment (see paragraph on LEADER for more details).
3629+ mLeaderStyle . TextTopAttachment = ( TextAttachmentType ) this . _objectReader . ReadBitShort ( ) ;
3630+ }
36243631
3625- // B 298 Undocumented, found in DXF
3626- mLeaderStyle . UnknownFlag298 = this . _objectReader . ReadBit ( ) ;
3632+ if ( this . R2013Plus )
3633+ {
3634+ // B 298 Undocumented, found in DXF
3635+ mLeaderStyle . UnknownFlag298 = this . _objectReader . ReadBit ( ) ;
3636+ }
36273637
36283638 return template ;
36293639 }
0 commit comments