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

Commit d53bd30

Browse files
committed
[2023/06/28] netDxf 3.0 Release
[2023/06/28] * Added the property WorkingFolder to DxfDocument.SupportFolders. When a file is loaded or saved, it will hold the full path where the file resides, by default it points to the current System.Environment.CurrentDirectory when the DxfDocument was created. * Now you can change the Name and Style properties of LinetypeShapeSegment classes. * Deleted the TextStyle constructors public TextStyle(string font) and public TextStyle(string fontFamily, FontStyle fontStyle), now you must also provide the table name. * Deleted the ShapeStyle constructor public ShapeStyle(string file), now you must also provide the table name.
1 parent 2dc2579 commit d53bd30

File tree

256 files changed

+607
-454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+607
-454
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
MIT License
22

33

4-
Copyright (c) 2019-2022 Daniel Carvajal (haplokuon@gmail.com)
4+
Copyright (c) 2019-2023 Daniel Carvajal (haplokuon@gmail.com)
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ public static void Main()
3737
Are contained in the source code.
3838
Well, at the moment they are just tests for the work in progress.
3939
## Dependencies and distribution
40-
Multitarget project, predefined frameworks for Net Framework 4.8, Net Standard 2.1, Net Core 3.1, NET 5.0, and NET 6.0.
41-
Additionally the Net Standard 2.1 build requires a reference to the external library "System.Text.Encoding.CodePages".
40+
Multitarget project, predefined frameworks for Net Framework 4.8 and NET 6.0.
4241
## Compiling
4342
Visual Studio 2022. The solution file is still usable by Visual Studio 2019 but it does not support NET 6.0.
4443
netDxf is compatible with any net version from Net Framework 4.0.

TestDxfDocument/Program.cs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
using Image = netDxf.Entities.Image;
2020
using Point = netDxf.Entities.Point;
2121
using Trace = netDxf.Entities.Trace;
22-
using Vector2 = netDxf.Vector2;
23-
using Vector3 = netDxf.Vector3;
2422

2523
namespace TestDxfDocument
2624
{
@@ -2230,7 +2228,7 @@ public static void TextMirror()
22302228

22312229
public static void ShapeMirror()
22322230
{
2233-
ShapeStyle style = new ShapeStyle("shape.shx");
2231+
ShapeStyle style = new ShapeStyle("MyShapeStyle", "shape.shx");
22342232
Shape shape1 = new Shape("MyShape", style);
22352233
shape1.ObliqueAngle = 20;
22362234

@@ -3244,7 +3242,7 @@ private static void TestModelSpaceBlock()
32443242
private static void Shape()
32453243
{
32463244
// create the shape style from the file where the shape definitions are stored
3247-
ShapeStyle style = new ShapeStyle("shape.shx");
3245+
ShapeStyle style = new ShapeStyle("MyShapeStyle", "shape.shx");
32483246
// create the shape entity from the style where the same named "MyShape" is stored (name case is ignored)
32493247
Shape shape = new Shape("MyShape", style);
32503248

@@ -5699,7 +5697,7 @@ private static void MeshEntity()
56995697

57005698
private static void MTextEntity()
57015699
{
5702-
TextStyle style = new TextStyle("Arial");
5700+
TextStyle style = new TextStyle("MyTextStyle", "Arial", FontStyle.Regular);
57035701

57045702
MText text1 = new MText(Vector2.Zero, 10, 0, style);
57055703
// you can set manually the text value with all available formatting commands
@@ -6240,9 +6238,9 @@ private static void LinearDimensionTests()
62406238
private static void TestingTrueTypeFonts()
62416239
{
62426240
DxfDocument dxfText = new DxfDocument();
6243-
TextStyle textStyle1 = new TextStyle(@"arial.ttf");
6244-
TextStyle textStyle2 = new TextStyle("arialbi.ttf");
6245-
TextStyle textStyle3 = new TextStyle(@"C:\Windows\Fonts\91118.ttf");
6241+
TextStyle textStyle1 = new TextStyle("MyTextStyle", "arial.ttf");
6242+
TextStyle textStyle2 = new TextStyle("MyTextStyle", "arialbi.ttf");
6243+
TextStyle textStyle3 = new TextStyle("MyTextStyle", "C:\\Windows\\Fonts\\91118.ttf");
62466244
textStyle3.Name = textStyle3.FontFamilyName;
62476245
Text text1 = new Text("testing", Vector2.Zero, 6, textStyle1);
62486246
Text text2 = new Text("testing", Vector2.Zero, 6, textStyle2);
@@ -6744,7 +6742,7 @@ private static void TextAndDimensionStyleUsesAndRemove()
67446742
block.AttributeDefinitions.Add(attdef);
67456743

67466744
Insert insert = new Insert(block, new Vector2(5, 5));
6747-
insert.Attributes[0].Style = new TextStyle("Arial.ttf");
6745+
insert.Attributes[0].Style = new TextStyle("MyTextStyle", "Arial.ttf");
67486746

67496747
dxf.Entities.Add(insert);
67506748

@@ -6761,7 +6759,7 @@ private static void TextAndDimensionStyleUsesAndRemove()
67616759
dxf.Entities.Add(line);
67626760

67636761
DimensionStyle myStyle = new DimensionStyle("MyStyle");
6764-
myStyle.TextStyle = new TextStyle("Tahoma.ttf");
6762+
myStyle.TextStyle = new TextStyle("MyTextStyle", "Tahoma.ttf");
67656763
myStyle.DimSuffix = "mm";
67666764
myStyle.LengthPrecision = 2;
67676765
double offset = 7;
@@ -7272,7 +7270,7 @@ private static void Text()
72727270

72737271
private static void WriteNoAsciiText()
72747272
{
7275-
TextStyle textStyle = new TextStyle("Arial.ttf");
7273+
TextStyle textStyle = new TextStyle("MyTextStyle", "Arial.ttf");
72767274
DxfDocument dxf = new DxfDocument();
72777275
dxf.DrawingVariables.LastSavedBy = "ЉЊЋЌЍжзицрлЯ";
72787276
//Text text = new Text("ÁÉÍÓÚ áéíóú Ññ àèìòù âêîôû", Vector2.Zero,10);
@@ -7762,7 +7760,7 @@ private static void WriteMText()
77627760
xdata.XDataRecord.Add(XDataRecord.CloseControlString);
77637761

77647762
//text
7765-
TextStyle style = new TextStyle("Times.ttf");
7763+
TextStyle style = new TextStyle("MyTextStyle", "Times.ttf");
77667764
//TextStyle style = TextStyle.Default;
77677765
MText mText = new MText(new Vector3(3, 2, 0), 1.0f, 100.0f, style);
77687766
mText.Layer = new Layer("Multiline Text");

doc/Changelog.txt

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
## Change history
22

3-
### [2023/04/27]
3+
### [3.0.0 - 2023/06/28]
4+
5+
[2023/06/28]
6+
* Added the property WorkingFolder to DxfDocument.SupportFolders. When a file is loaded or saved, it will hold the full path where the file resides, by default it points to the current System.Environment.CurrentDirectory when the DxfDocument was created.
7+
* Now you can change the Name and Style properties of LinetypeShapeSegment classes.
8+
* Deleted the TextStyle constructors public TextStyle(string font) and public TextStyle(string fontFamily, FontStyle fontStyle), now you must also provide the table name.
9+
* Deleted the ShapeStyle constructor public ShapeStyle(string file), now you must also provide the table name.
10+
11+
[2023/04/27]
412
* Removed the taget frameworks netstandard2.1, netcoreapp3.1, and net5.0. Manually edit the netDxf.proj if you need them.
513
* Reworked how the references to a TableObject are tracked. Now they are internally stored in a dictionary instead of a list. While this will make adding entities to the document a little slower removing them will be much faster. See the sample TableObjectReferences().
614
* Add the method GetReferences to classes that inherit from TableObject. It returns the same list as the GetReferences method of its respective collection. See the sample TableObjectReferences().
@@ -9,7 +17,7 @@
917
* (fixed) Removing dimension entities with no associated block. This is the case of dimensions whick block has left null to force the program that loads the resulting DXF to generate its own dimension block.
1018
* (fixed) Error when loading a closed periodic spline from a DXF without weights.
1119

12-
### [2023/03/05]
20+
[2023/03/05]
1321
* Changed the default target framework 'net45' for 'net48'. The library is compatible will all 4.x net framework versions.
1422
* Renamed the constant 'NET45' with 'NET4X' in netDxf.csproj. This constant must be applicable when compiling against any net framework 4.x versions.
1523
* Normalizing a zero vector will return the Zero vector instead of NaN.
@@ -26,10 +34,10 @@
2634
* (fixed) Workaround for possible bad formatted tolerance string representations.
2735
* (fixed) The vectors that define the start and end angle for 3 point angular dimensions can be parallel. This restriction still true for angular 2 line dimensions.
2836

29-
### [2022/11/02]
37+
[2022/11/02]
3038
* Fixed a bug in the AciColor.FromHsl method, under certain circumstances the RGB values where not calculated correctly.
3139

32-
### [2022/11/01]
40+
[2022/11/01]
3341
* Workaround for bad DXF files that contain polyface with invalid geometry, they will be removed.
3442
* Workaround for bad DXF files that contains entities without handles. This may derive in unexpected side effects.
3543
* Workaround for bad DXF files lacking BLOCK_RECORD tables for the defined blocks. The default block record values will be given what may have other side effects.
@@ -38,18 +46,18 @@
3846
* Added NET 6.0 as a target framework.
3947
* Updated netDxf solution for Visual Studio 2022. The solution file is still usable by Visual Studio 2019 but it does not support NET 6.0.
4048

41-
### [2022/05/27]
49+
[2022/05/27]
4250
* Added the Matrix3.Reflection method that builds a reflection matrix for a mirror plane that passes through the origin. See sample ReflectionMatrix().
4351
* Added the Matrix4.Reflection method that builds a reflection matrix for a mirror plane that passes through an arbitrary point. See sample ReflectionMatrix().
4452
* Corrected the comments in the Ellipse.Center property.
4553
* (fixed) In the Ellipse.SetAxis method the validity checks must be performed with the arguments of the method not the actual major and minor axis of the ellipse.
4654

47-
### [2022/04/19]
55+
[2022/04/19]
4856
* Added more GTE classes. See the Samples for GTE classes
4957
* Deleted the SplineVertex class. Now the Spline constructors take two lists: a Vector3 to define the controls points and a double array to define the weights.
5058
* PolygonMesh entities are now capable to handle closed in U and/or V surfaces.
5159

52-
### [2022/04/10]
60+
[2022/04/10]
5361
* Added CalculateTangent for Quadratic and Cubic Bezier curves.
5462
* Added PolygonMesh entity. See PolygonMesh() sample.
5563
* Added the drawing variables SurfU and SurfV.
@@ -58,17 +66,17 @@
5866
* (fixed) Some issues when reading and writing attributes and attribute definitions, related with the fit and aligned Alignment property.
5967
* (fixed) Attribute and AttributeDefinition properties IsBackward and IsUpsideDown were not written nor read.
6068

61-
### [2022/02/13]
69+
[2022/02/13]
6270
* Cleanup code when reading and writing some dimension style variables and overrides.
6371
* (fixed) Issue when writing the header variable $DIMAPOST.
6472
* (fixed) Some issues with reading and writing dimension style overrides.
6573

66-
### [2022/01/26]
74+
[2022/01/26]
6775
* The Polyline2D and Polyline3D Explode method will preserve the smooth type.
6876
* Deleted the references to the ImageDefinitionReactor from the ImageDefinition they will be created when the DXF is saved.
6977
* (fixed) Issues, introduced in the last two updates, when saving Polyline2D, Polyline3D, and PolyfaceMesh entities that were part of a Block.
7078

71-
### [2021/12/06]
79+
[2021/12/06]
7280
* Rename Face3d to Face3D.
7381
* Rename Face3dEdgeFlags to Face3DEdgeFlags.
7482
* Rename DxfDocument.Entities.Faces3d to DxfDocument.Entities.Faces3D.
@@ -94,7 +102,7 @@
94102
* The SmoothType (None, Quadratic, or Cubic) can now be set for Polyline2D entity (formerly LwPolyline) and Polyline3D (formerly Polyline).
95103
* Updated the file "netDxf Documentation.chm".
96104

97-
### [2021/10/24]
105+
[2021/10/24]
98106
* The internal blocks that start with "*U" or "*T" can be safely renamed. They are internally created to represent dynamic blocks, arrays, and tables; although the information of those objects is lost when importing the DXF, the block that represent its graphical appearance is imported.
99107
* PolyfaceMesh vertexes are now a list of Vector3. The additional information that the DXF requires will be generated when the file is saved.
100108
* Deleted the PolyfaceMeshVertex class, there is no use for it anymore.
@@ -115,7 +123,7 @@
115123
* (fixed) Workaround for multiline styles with no name in bad formated DXF files.
116124
* (fixed) The precision argument of the Arc.PolygonalVertexes method represents the number of vertexes genarated not the number of division, as it is the case of similar methods of other entities.
117125

118-
### [2021/09/18]
126+
[2021/09/18]
119127
* Leader entitities with less than two vertices will be deleted when loading a DXF file.
120128
* (fixed) Changed the default DxfDocument comment to show that netDxf is licensed under MIT.
121129
* (fixed) Possible out of range error for the LuPrec header variable when reading a DXF file. Out of range values will default to 4.
@@ -124,10 +132,10 @@
124132
* (fixed) The default linetype will be given to a layer state if the specified one in the DXF is not found.
125133
* (fixed) Complex linetypes assigned to a layer were not properly initialized.
126134

127-
### [2021/06/20]
135+
[2021/06/20]
128136
* Loading AutoCad2000 (AC1015) or AutoCad2004 (AC1018) DXF files containing non-ASCII characters will work once again. Additionally the Net Standard 2.1 build requires a reference to the external library "System.Text.Encoding.CodePages".
129137

130-
### [2021/05/23]
138+
[2021/05/23]
131139
* Added two methods to the MathHelper class to transform object 2d coordinates to world coordinates given the entity normal and elevation.
132140
* Added two methods to the MathHelper class to transform world coordinates to object 2d coordinates given the entity normal, they also return as an out parameter the average Z axis value of the transformed points.
133141
* Deleted netDxf.nuspec file.
@@ -138,15 +146,15 @@
138146
Also a call to the Update method is not done automatically. It is needed to reflect the actual properties and style of the Leader, but there might be special cases when it is needed to have control over it.
139147
See "AssignAnnotationToLeader()" sample.
140148

141-
### [2021/05/02]
149+
[2021/05/02]
142150
* Added netDxf.nuspec file.
143151
* Ellipses with its major axis smaller than its minor axis are not allowed.
144152
* Streams with not accessible Position property are not supported.
145153
* (fixed) LayerState containing a non existent layer will not be added.
146154
This behaviour differs when the LayerState comes from an external LAS file, in the latter case the non existent layer is added to the document. This is to allow the LAS file to be used layers templates.
147155
Additionally if the LayerState points to a non existent linetype, the default "Standard" will be assigned.
148156

149-
### [2021/03/27]
157+
[2021/03/27]
150158
* The netDxf library is now licensed under the MIT License.
151159
* Updated solution file to Visual Studio 2019.
152160
* netDxf targets multiple frameworks, predefined frameworks for Net Framework 4.5, Net Standard 2.1, Net Core 3.1, and NET 5.0.
@@ -162,7 +170,7 @@
162170
It doesn't seems to play any role, open a new issue at GitHub if non-ASCII characters does not show up correctly.
163171
This will avoid the use of additional libraries to handle the encoding code pages.
164172

165-
### [2.4.2 - 2021/03/23]
173+
### [2.4.2 - 2021/03/23]
166174
* Now the ShapeStyle does not require the SHP file to read the shape information only the SHX must be present.
167175
* The Insert Sync method will not modify any value assigned to the attribute Value property.
168176
* (fixed) A couple errors when writing the style overrides of a dimension to the extended data.

netDxf/AciColor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#region netDxf library licensed under the MIT License
22
//
33
// netDxf library
4-
// Copyright (c) 2019-2023 Daniel Carvajal (haplokuon@gmail.com)
4+
// Copyright (c) Daniel Carvajal (haplokuon@gmail.com)
55
//
66
// Permission is hereby granted, free of charge, to any person obtaining a copy
77
// of this software and associated documentation files (the "Software"), to deal

netDxf/BezierCurve.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#region netDxf library licensed under the MIT License
22
//
33
// netDxf library
4-
// Copyright (c) 2019-2023 Daniel Carvajal (haplokuon@gmail.com)
4+
// Copyright (c) Daniel Carvajal (haplokuon@gmail.com)
55
//
66
// Permission is hereby granted, free of charge, to any person obtaining a copy
77
// of this software and associated documentation files (the "Software"), to deal

netDxf/BezierCurveCubic.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#region netDxf library licensed under the MIT License
22
//
33
// netDxf library
4-
// Copyright (c) 2019-2023 Daniel Carvajal (haplokuon@gmail.com)
4+
// Copyright (c) Daniel Carvajal (haplokuon@gmail.com)
55
//
66
// Permission is hereby granted, free of charge, to any person obtaining a copy
77
// of this software and associated documentation files (the "Software"), to deal

netDxf/BezierCurveQuadratic.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#region netDxf library licensed under the MIT License
22
//
33
// netDxf library
4-
// Copyright (c) 2019-2023 Daniel Carvajal (haplokuon@gmail.com)
4+
// Copyright (c) Daniel Carvajal (haplokuon@gmail.com)
55
//
66
// Permission is hereby granted, free of charge, to any person obtaining a copy
77
// of this software and associated documentation files (the "Software"), to deal

netDxf/Blocks/Block.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#region netDxf library licensed under the MIT License
22
//
33
// netDxf library
4-
// Copyright (c) 2019-2023 Daniel Carvajal (haplokuon@gmail.com)
4+
// Copyright (c) Daniel Carvajal (haplokuon@gmail.com)
55
//
66
// Permission is hereby granted, free of charge, to any person obtaining a copy
77
// of this software and associated documentation files (the "Software"), to deal

netDxf/Blocks/BlockAttributeDefinitionChangeEventArgs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#region netDxf library licensed under the MIT License
22
//
33
// netDxf library
4-
// Copyright (c) 2019-2021 Daniel Carvajal (haplokuon@gmail.com)
4+
// Copyright (c) Daniel Carvajal (haplokuon@gmail.com)
55
//
66
// Permission is hereby granted, free of charge, to any person obtaining a copy
77
// of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)