Skip to content

Commit

Permalink
CadDictionaryWithDefault
Browse files Browse the repository at this point in the history
  • Loading branch information
DomCR committed Oct 21, 2023
1 parent 85e7314 commit 70e1983
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ACadSharp/IO/DWG/DwgStreamWriters/DwgObjectWriter.Objects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ private void writeObject(CadObject obj)
case AcdbPlaceHolder acdbPlaceHolder:
this.writeAcdbPlaceHolder(acdbPlaceHolder);
break;
case CadDictionaryWithDefault dictionarydef:
this.writeCadDictionaryWithDefault(dictionarydef);
break;
case CadDictionary dictionary:
this.writeDictionary(dictionary);
break;
Expand Down Expand Up @@ -70,6 +73,14 @@ private void writeAcdbPlaceHolder(AcdbPlaceHolder acdbPlaceHolder)
{
}

private void writeCadDictionaryWithDefault(CadDictionaryWithDefault dictionary)
{
this.writeDictionary(dictionary);

//H 7 Default entry (hard pointer)
this._writer.HandleReference(DwgReferenceType.HardPointer, dictionary.DefaultEntry);
}

private void writeDictionary(CadDictionary dictionary)
{
//Common:
Expand Down
2 changes: 2 additions & 0 deletions ACadSharp/IO/DWG/DwgWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,9 @@ private void writeObjects()
{
MemoryStream stream = new MemoryStream();
DwgObjectWriter writer = new DwgObjectWriter(stream, this._document);
writer.OnNotification += this.triggerNotification;
writer.Write();

this._handlesMap = writer.Map;

this._fileHeaderWriter.AddSection(DwgSectionDefinition.AcDbObjects, stream, true);
Expand Down

0 comments on commit 70e1983

Please sign in to comment.