Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
[2020/12/06] netDxf 2.4.1 Release.
Browse files Browse the repository at this point in the history
* See Changelog.txt for a list of changes since 2.4.0
  • Loading branch information
haplokuon committed Dec 6, 2020
1 parent 8e9b814 commit 008c438
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# netDxf
netDxf 2.4.0 Copyright(C) 2009-2020 Daniel Carvajal, Licensed under LGPL
netDxf 2.4.1 Copyright(C) 2009-2020 Daniel Carvajal, Licensed under LGPL
## Description
netDxf is a .net library programmed in C# to read and write AutoCAD DXF files. It supports AutoCad2000, AutoCad2004, AutoCad2007, AutoCad2010, AutoCad2013, and AutoCad2018 DXF database versions, in both text and binary format.

Expand Down
19 changes: 6 additions & 13 deletions doc/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
## Change history

### [2020/11/16]
### [2.4.1 - 2020/12/06]
* Added LayerStates accessible trough the Layers.StateManager. For more details see LayerStateManager() sample.
* Added some workarounds for invalid values in buggy DXF files.
* Renamed AttributeFlags.Visible to AttributeFlags.None.
* Renamed Face3dEdgeFlags.Visibles to AttributeFlags.None.
* The AttributeDefiniton and Attribute Value property are now stored as strings.
The user will be responsible on how to convert this value to and from the string.
In the end this value is always stored in a DXF file as a string (code 1),
and how the conversion is done from a generic object value may differ from user to user.

### [2020/11/14]
* Now it is possible to change the ImageDefinition of an Image entity.
* Now it is possible to change the UnderlayDefinition of an Underlay entity.
* Now it is possible to change the ShapeStyle and Name of a Shape entity.
You will need to make sure that the actual shape style file has a shape with the actual name.
There are a few methods to help you with that in the ShapeStyle class but they only work with the SHP shape files.
* (fixed) Error creating the Underlay definition dictionaries when multiple entries of the same type PDF, DWF, or DGN where present.

### [2020/11/09]
* Added some workarounds for invalid values in buggy DXF files.
* (fixed) In the ACAD_DICTIONARY info, for the Layer table, a "{" was written instead of "}".


### [2020/08/20]
* Added LayerStates accessible trough the Layers.StateManager. For more details see LayerStateManager() sample.
* Renamed AttributeFlags.Visible to AttributeFlags.None.
* Renamed Face3dEdgeFlags.Visibles to AttributeFlags.None.
* (fixed) Linetypes that contain complex segments were not being added to corresponding reference list of the TextSyle or ShapeStyle.
* (fixed) The layer transparency was not being written correctly to the DXF.
* (fixed) Blocks associated to paper space layouts can contain attribute definitions, although its use is uncommon there is no reason they cannot have them.
* (fixed) Issue with DXFs with multiple Model viewports (VPorts) that contain extended data information.
Expand Down
Binary file modified doc/netDxf Documentation.chm
Binary file not shown.
2 changes: 1 addition & 1 deletion netDxf/Collections/AttributeDefinitionDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public AttributeDefinition this[string tag]
throw new ArgumentException(string.Format("The dictionary tag: {0}, and the attribute definition tag: {1}, must be the same", tag, value.Tag));

// there is no need to add the same object, it might cause overflow issues
if (ReferenceEquals(this.innerDictionary[tag].Value, value))
if (ReferenceEquals(this.innerDictionary[tag], value))
return;

AttributeDefinition remove = this.innerDictionary[tag];
Expand Down
8 changes: 6 additions & 2 deletions netDxf/Collections/Linetypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ public override bool Remove(Linetype item)
if (this.references[item.Name].Count != 0)
return false;

LinetypeSegment[] segments = new LinetypeSegment[item.Segments.Count];
item.Segments.CopyTo(segments, 0);
item.Segments.Remove(segments);

this.Owner.AddedObjects.Remove(item.Handle);
this.references.Remove(item.Name);
this.list.Remove(item.Name);
Expand Down Expand Up @@ -268,13 +272,13 @@ private void Linetype_SegmentAdded(Linetype sender, LinetypeSegmentChangeEventAr
{
LinetypeTextSegment textSegment = (LinetypeTextSegment)e.Item;
textSegment.Style = this.Owner.TextStyles.Add(textSegment.Style);
//this.Owner.TextStyles.References[textSegment.Style.Name].Add(sender);
this.Owner.TextStyles.References[textSegment.Style.Name].Add(sender);
}
if (e.Item.Type == LinetypeSegmentType.Shape)
{
LinetypeShapeSegment shapeSegment = (LinetypeShapeSegment)e.Item;
shapeSegment.Style = this.Owner.ShapeStyles.Add(shapeSegment.Style);
//this.Owner.ShapeStyles.References[shapeSegment.Name].Add(sender);
this.Owner.ShapeStyles.References[shapeSegment.Name].Add(sender);
}
}

Expand Down
7 changes: 6 additions & 1 deletion netDxf/Entities/Attribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace netDxf.Entities
{
/// <summary>
/// Represents a attribute <see cref="EntityObject">entity</see>.
/// Represents a attribute.
/// </summary>
/// <remarks>
/// The attribute position, rotation, height and width factor values also includes the transformation of the <see cref="Insert">Insert</see> entity to which it belongs.<br />
Expand Down Expand Up @@ -702,6 +702,11 @@ public object Clone()
IsUpsideDown = this.isUpsideDown
};

foreach (XData data in this.XData.Values)
{
entity.XData.Add((XData) data.Clone());
}

return entity;
}

Expand Down
3 changes: 1 addition & 2 deletions netDxf/Entities/AttributeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
namespace netDxf.Entities
{
/// <summary>
/// Represents an attribute definition <see cref="EntityObject">entity</see>.
/// Represents an attribute definition.
/// </summary>
/// <remarks>
/// AutoCad allows to have duplicate tags in the attribute definitions list, but this library does not.
Expand Down Expand Up @@ -716,6 +716,5 @@ public object Clone()
}

#endregion

}
}
2 changes: 2 additions & 0 deletions netDxf/Tables/Linetype.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ public Linetype(string name, string description)
/// Initializes a new instance of the <c>Linetype</c> class.
/// </summary>
/// <param name="name">Line type name.</param>
/// <param name="segments">List of linetype segments.</param>
public Linetype(string name, IEnumerable<LinetypeSegment> segments)
: this(name, segments, string.Empty, true)
{
Expand All @@ -238,6 +239,7 @@ public Linetype(string name, IEnumerable<LinetypeSegment> segments)
/// Initializes a new instance of the <c>Linetype</c> class.
/// </summary>
/// <param name="name">Line type name.</param>
/// <param name="segments">List of linetype segments.</param>
/// <param name="description">Line type description.</param>
public Linetype(string name, IEnumerable<LinetypeSegment> segments, string description)
: this(name, segments, description, true)
Expand Down

0 comments on commit 008c438

Please sign in to comment.