Saving drawing with 'SaveToStream' creates broken file
Moderators: SDS, support, admin
-
- Posts: 22
- Joined: 06 Jul 2018, 10:52
Saving drawing with 'SaveToStream' creates broken file
Hello Support,
I am using the SaveToStream function to write a drawing into a stream, which is stored in a database. It is also possible to create a DWG file with this data. Sometimes the exported file seems to be corrupt, at least TrueView shows a message when opening those files:
"Errors were detected in the drawing. The file cannot be opened without being recovered."
Is there a way to check what is causing those issues?
I am sorry that I cannot attach the generated file to this thread but I could mail it to you if this would help you.
Thank you,
Stefan
I am using the SaveToStream function to write a drawing into a stream, which is stored in a database. It is also possible to create a DWG file with this data. Sometimes the exported file seems to be corrupt, at least TrueView shows a message when opening those files:
"Errors were detected in the drawing. The file cannot be opened without being recovered."
Is there a way to check what is causing those issues?
I am sorry that I cannot attach the generated file to this thread but I could mail it to you if this would help you.
Thank you,
Stefan
Re: Saving drawing with 'SaveToStream' creates broken file
Hello Stephan,
Please post a code which generates a DWG file from a stream, we will check it.
Mikhail
Please post a code which generates a DWG file from a stream, we will check it.
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
-
- Posts: 22
- Joined: 06 Jul 2018, 10:52
Re: Saving drawing with 'SaveToStream' creates broken file
Hello Mikhail,
this is the codes that stores the DWG file:
Thank you.
this is the codes that stores the DWG file:
Code: Select all
Dim s = New System.IO.MemoryStream
CADtoDWG.SaveToStream(Drawing, s)
Dim fs As New FileStream("C:\TMP\" & Date.Now.ToString("yyyy-MM-dd") & ".dwg", FileMode.Create)
s.WriteTo(fs)
fs.Close()
s.Close()
Re: Saving drawing with 'SaveToStream' creates broken file
Hello Stefan,
The code is correct. Could you please mail us the drawing which you save through a MemoryStream and get a corrupted DWG file?
Mikhail
The code is correct. Could you please mail us the drawing which you save through a MemoryStream and get a corrupted DWG file?
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support