From ea075e38d82d4ad220c8819a471f1e0399ddb5f2 Mon Sep 17 00:00:00 2001 From: DomCR Date: Thu, 19 Dec 2024 17:49:17 +0100 Subject: [PATCH 1/3] test --- .../IO/DWG/DwgStreamReaders/DwgObjectReader.cs | 18 ++++++++++++++---- src/ACadSharp/Objects/VisualStyle.cs | 5 +++++ 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs index adf78481a..15f633901 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs @@ -1040,9 +1040,9 @@ private CadTemplate readUnlistedType(short classNumber) case "SORTENTSTABLE": template = this.readSortentsTable(); break; - //case "VISUALSTYLE": - // template = this.readVisualStyle(); - // break; + case "VISUALSTYLE": + template = this.readVisualStyle(); + break; case "WIPEOUT": template = this.readCadImage(new Wipeout()); break; @@ -5313,9 +5313,19 @@ private CadTemplate readVisualStyle() //WARNING: this object is not documented, the fields have been found using exploration methods and matching them with the dxf file - visualStyle.Description = this._textReader.ReadVariableText(); + //2 Name + visualStyle.Name = this._textReader.ReadVariableText(); + //70 visualStyle.Type = this._objectReader.ReadBitLong(); + //177 + _objectReader.ReadBitShort(); + //291 Internal use only flag + _objectReader.ReadBit(); + + //70 Count then repeat 90 and 176 + int count = this._objectReader.ReadBitLong(); + #if TEST var objValues = DwgStreamReaderBase.Explore(_objectReader); var textValues = DwgStreamReaderBase.Explore(_textReader); diff --git a/src/ACadSharp/Objects/VisualStyle.cs b/src/ACadSharp/Objects/VisualStyle.cs index 8f4ce3fbc..988d96d9a 100644 --- a/src/ACadSharp/Objects/VisualStyle.cs +++ b/src/ACadSharp/Objects/VisualStyle.cs @@ -13,6 +13,11 @@ namespace ACadSharp.Objects [DxfSubClass(DxfSubclassMarker.VisualStyle)] public class VisualStyle : NonGraphicalObject { + /// + /// Default name. + /// + public const string DefaultName = "2dWireframe"; + /// public override ObjectType ObjectType => ObjectType.UNLISTED; From e5b938b953b4d9916995bbb78bafac83caba3fd4 Mon Sep 17 00:00:00 2001 From: DomCR Date: Thu, 19 Dec 2024 20:25:18 +0100 Subject: [PATCH 2/3] return template --- src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs index 15f633901..af49141bd 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs @@ -5331,7 +5331,7 @@ private CadTemplate readVisualStyle() var textValues = DwgStreamReaderBase.Explore(_textReader); #endif - return null; + return template; } private CadTemplate readCadImage(CadImageBase image) From e7597627cd68fe1fc423e3a22368c4558219d54e Mon Sep 17 00:00:00 2001 From: DomCR Date: Thu, 19 Dec 2024 20:25:18 +0100 Subject: [PATCH 3/3] return template --- src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs index 15f633901..0cf9a70a8 100644 --- a/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs +++ b/src/ACadSharp/IO/DWG/DwgStreamReaders/DwgObjectReader.cs @@ -5319,9 +5319,9 @@ private CadTemplate readVisualStyle() visualStyle.Type = this._objectReader.ReadBitLong(); //177 - _objectReader.ReadBitShort(); + var value177 = _objectReader.ReadBitShort(); //291 Internal use only flag - _objectReader.ReadBit(); + var value291 = _objectReader.ReadBit(); //70 Count then repeat 90 and 176 int count = this._objectReader.ReadBitLong(); @@ -5331,7 +5331,7 @@ private CadTemplate readVisualStyle() var textValues = DwgStreamReaderBase.Explore(_textReader); #endif - return null; + return template; } private CadTemplate readCadImage(CadImageBase image)