Skip to content

Commit

Permalink
Merge pull request DomCR#323 from nanoLogika/20240322_mme_writeMultiL…
Browse files Browse the repository at this point in the history
…eader

20240322 mme write multi leader
  • Loading branch information
DomCR authored Jul 16, 2024
2 parents deeb27e + 05e17eb commit 3d6943f
Show file tree
Hide file tree
Showing 19 changed files with 1,302 additions and 152 deletions.
4 changes: 2 additions & 2 deletions ACadSharp/DxfFileToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ public static class DxfFileToken
public const string EntityLine = "LINE";
public const string EntityLwPolyline = "LWPOLYLINE";
public const string EntityMesh = "MESH";
public const string EntityMLeader = "MLEADER";
public const string EntityMLeaderStyle = "MLEADERSTYLE";
public const string EntityMultiLeader = "MULTILEADER";
public const string EntityMLine = "MLINE";
public const string EntityMText = "MTEXT";
public const string EntityOleFrame = "OLEFRAME";
Expand Down Expand Up @@ -114,6 +113,7 @@ public static class DxfFileToken
public const string ObjectPlotSettings = "PLOTSETTINGS";
public const string ObjectPlaceholder = "ACDBPLACEHOLDER";
public const string ObjectLayout = "LAYOUT";
public const string ObjectMLeaderStyle = "MLEADERSTYLE";
public const string ObjectImageDefinition = "IMAGEDEF";
public const string ObjectImageDefinitionReactor = "IMAGEDEF_REACTOR";
public const string ObjectMLineStyle = "MLINESTYLE";
Expand Down
2 changes: 1 addition & 1 deletion ACadSharp/DxfSubclassMarker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static class DxfSubclassMarker
public const string Vertex = "AcDbVertex";
public const string Polyline = "AcDb2dPolyline";
public const string Leader = "AcDbLeader";
public const string MLeader = "AcDbMLeader";
public const string MultiLeader = "AcDbMLeader";
public const string MLeaderStyle = "AcDbMLeaderStyle";
public const string MultiLeaderAnnotContext = "AcDbMultiLeaderAnnotContext";
public const string LwPolyline = "AcDbPolyline";
Expand Down
326 changes: 281 additions & 45 deletions ACadSharp/Entities/MultiLeader.cs

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2913,7 +2913,7 @@ private CadTemplate readMultiLeader()
// 43 Block Content Rotation
mLeader.BlockContentRotation = this._objectReader.ReadBitDouble();
// 176 Block Content Connection Type
mLeader.BlockContentConnection = (BlockContentConnectionType)_objectReader.ReadBitShort();
mLeader.BlockContentConnection = (BlockContentConnectionType)this._objectReader.ReadBitShort();
// 293 Enable Annotation Scale/Is annotative
mLeader.EnableAnnotationScale = this._objectReader.ReadBit();

Expand All @@ -2935,7 +2935,7 @@ private CadTemplate readMultiLeader()
}

// BL Number of Block Labels
int blockLabelCount = this._objectReader.ReadBitShort();
int blockLabelCount = this._objectReader.ReadBitLong();
for (int bl = 0; bl < blockLabelCount; bl++)
{
// 330 Block Attribute definition handle (hard pointer)
Expand Down Expand Up @@ -2994,7 +2994,7 @@ private MultiLeaderAnnotContext readMultiLeaderAnnotContext(CadMLeaderTemplate t

// Common
// BD 40 Overall scale
annotContext.ScaleFactor = _objectReader.ReadBitDouble();
annotContext.ScaleFactor = this._objectReader.ReadBitDouble();
// 3BD 10 Content base point
annotContext.ContentBasePoint = this._objectReader.Read3BitDouble();
// BD 41 Text height
Expand Down Expand Up @@ -3218,13 +3218,13 @@ private LeaderLine readLeaderLine(CadMLeaderTemplate template)
leaderLine.SegmentIndex = this._objectReader.ReadBitLong();

// Start/end point pairs
// 3BD 11 Start Point
// 3BD 12 End point
int startEndPointCount = this._objectReader.ReadBitLong();
for (int sep = 0; sep < startEndPointCount; sep++)
{
leaderLine.StartEndPoints.Add(new StartEndPointPair(
// 3BD 11 Start Point
this._objectReader.Read3BitDouble(),
// 3BD 12 End point
this._objectReader.Read3BitDouble()));
}
}
Expand Down Expand Up @@ -3316,7 +3316,7 @@ private CadTemplate readMultiLeaderStyle()
mLeaderStyle.TextAngle = (TextAngleType)this._objectReader.ReadBitShort();

} // END IF IsNewFormat OR DXF file
// BS 176 Text alignment type
// BS 176 Text alignment type
mLeaderStyle.TextAlignment = (TextAlignmentType)this._objectReader.ReadBitShort();
// CMC 93 Text color
mLeaderStyle.TextColor = this._mergedReaders.ReadCmColor();
Expand All @@ -3329,8 +3329,8 @@ private CadTemplate readMultiLeaderStyle()
// B 297 Always align text left
mLeaderStyle.TextAlignAlwaysLeft = this._objectReader.ReadBit();
}// END IF IsNewFormat OR DXF file
// BD 46 Align space
mLeaderStyle.AlignSpace = _objectReader.ReadBitDouble();
// BD 46 Align space
mLeaderStyle.AlignSpace = this._objectReader.ReadBitDouble();
// H 343 Block handle (hard pointer)
template.BlockContentHandle = this.handleReference();
// CMC 94 Block color
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using ACadSharp.Entities;
using ACadSharp.Tables;
using CSUtilities.Converters;
using System;
using System.IO;

namespace ACadSharp.IO.DWG
Expand Down
Loading

0 comments on commit 3d6943f

Please sign in to comment.