Can't open DXF file generated by cad.net

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
AliHatam
Posts: 13
Joined: 13 Aug 2021, 08:56

Can't open DXF file generated by cad.net

Post by AliHatam » 05 May 2022, 16:10

We use cad.net in our project and generate an output file in DXF format . But generated file doesn't open in Autodesk Autocad software . the generated file open in cad.net editor and viewer properly (Chiral.jpg) . I attach generated file for more investigation (generatedDxfFile in attachments) . That is important for us and our customers the file to be opened in Autocad
I also tested dwg output , but I have same results
We genrate this file in this way :
In summary , we read some blocks from other file (dwg file - BaseBlocks in attachments) , draw some lines and genreate some layers and generate final file
Attachments
Chiral.JPG
Chiral.JPG (261.2 KiB) Viewed 4773 times
BaseBlocks.zip
(494.78 KiB) Downloaded 537 times
generatedDxfFile.zip
(118.44 KiB) Downloaded 547 times

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: Can't open DXF file generated by cad.net

Post by support » 06 May 2022, 12:12

Hi,

Thank you for your mesage.

Could you please let me know the CAD .NET version that you are using?
Could you please also send me an example code (e.g. by email or PM me) that you are using to generate the file?

Maria
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

AliHatam
Posts: 13
Joined: 13 Aug 2021, 08:56

Re: Can't open DXF file generated by cad.net

Post by AliHatam » 07 May 2022, 07:56

Hi
The CAD.NET version is 14.1.0.47734

About code , it's very huge and as you can see the cad file contains very elements . but I will try to send you a portion of it .

AliHatam
Posts: 13
Joined: 13 Aug 2021, 08:56

Re: Can't open DXF file generated by cad.net

Post by AliHatam » 07 May 2022, 16:49

Hi Maria
I sent you an email includes sample codes we used . thanks

AliHatam
Posts: 13
Joined: 13 Aug 2021, 08:56

Re: Can't open DXF file generated by cad.net

Post by AliHatam » 10 May 2022, 12:34

support wrote:
06 May 2022, 12:12
Hi,

Thank you for your mesage.

Could you please let me know the CAD .NET version that you are using?
Could you please also send me an example code (e.g. by email or PM me) that you are using to generate the file?

Maria
Hello, can you say that a mistake or a bug caused this file export error?
We want to release the first version of our software but this problem has prevented us

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: Can't open DXF file generated by cad.net

Post by support » 16 May 2022, 10:49

AliHatam wrote:
10 May 2022, 12:34
support wrote:
06 May 2022, 12:12
Hi,

Thank you for your message.

Could you please let me know the CAD .NET version that you are using?
Could you please also send me an example code (e.g. by email or PM me) that you are using to generate the file?

Maria
Hello, can you say that a mistake or a bug caused this file export error?
We want to release the first version of our software but this problem has prevented us
Hi,
This error happens because the file contains two blockrecords with the same handles, and each handle should be unique.

Catherine.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

AliHatam
Posts: 13
Joined: 13 Aug 2021, 08:56

Re: Can't open DXF file generated by cad.net

Post by AliHatam » 17 May 2022, 10:02

support wrote:
16 May 2022, 10:49

Hi,
This error happens because the file contains two blockrecords with the same handles, and each handle should be unique.

Catherine.
Hi , thank you so much for answer
We have many blocks in our file , can you give me more info about that 2 blocks , a name or other info that help us to find it easily ?

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: Can't open DXF file generated by cad.net

Post by support » 17 May 2022, 10:54

AliHatam wrote:
17 May 2022, 10:02
support wrote:
16 May 2022, 10:49

Hi,
This error happens because the file contains two blockrecords with the same handles, and each handle should be unique.

Catherine.
Hi , thank you so much for answer
We have many blocks in our file , can you give me more info about that 2 blocks , a name or other info that help us to find it easily ?
Hi,
Please, have a look at the all blockrecords that have same handle =C0F7.

Catherine.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

AliHatam
Posts: 13
Joined: 13 Aug 2021, 08:56

Re: Can't open DXF file generated by cad.net

Post by AliHatam » 24 May 2022, 17:33

A lot of our errors fixed by this advice
but we have some other errors. I think your help can help us to fix.

We have 3 Test file :
Test1.dwg ( In Dwgs.zip) shows normally in our software but after consume a lot of memory will not open in Autocad and system hangs.

Test2.dwg ( In Dwgs.zip) shows normally in our software but when open in Auotcad there is some errors
( Test2 - In Our Software.png , Test2 - In Autocad-Before Open.png ,Test2- In Autocad.png in Images)

Test3.dwg same as Test2.dwg
Attachments
Dwgs.zip
(511.27 KiB) Downloaded 535 times
Images.zip
(380.07 KiB) Downloaded 527 times

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: Can't open DXF file generated by cad.net

Post by support » 25 May 2022, 12:01

AliHatam wrote:
24 May 2022, 17:33
A lot of our errors fixed by this advice
but we have some other errors. I think your help can help us to fix.

We have 3 Test file :
Test1.dwg ( In Dwgs.zip) shows normally in our software but after consume a lot of memory will not open in Autocad and system hangs.

Test2.dwg ( In Dwgs.zip) shows normally in our software but when open in Auotcad there is some errors
( Test2 - In Our Software.png , Test2 - In Autocad-Before Open.png ,Test2- In Autocad.png in Images)

Test3.dwg same as Test2.dwg
Hi,
I examined the files you sent. The Test1 - Error.dwg file wasn't created by either our software or AutoCAD and it contains errors, more precisely, it has a lot of blockrecords with the same name and handle, e.g.
BRANCH - $BF6F
GLOBEVALVE - $BF70
VPRESSUREGAGE - $BF71
...
Other files seem to have the same problem.
As a solution, you can open such files in AutoCAD and recover them. For more information about recovering files, please, refer to https://www.easeus.com/file-recovery/re ... matically.

Catherine.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

AliHatam
Posts: 13
Joined: 13 Aug 2021, 08:56

Re: Can't open DXF file generated by cad.net

Post by AliHatam » 16 Jun 2022, 09:41

support wrote:
25 May 2022, 12:01
Hi,
I examined the files you sent. The Test1 - Error.dwg file wasn't created by either our software or AutoCAD and it contains errors, more precisely, it has a lot of blockrecords with the same name and handle, e.g.
BRANCH - $BF6F
GLOBEVALVE - $BF70
VPRESSUREGAGE - $BF71
...
Other files seem to have the same problem.
As a solution, you can open such files in AutoCAD and recover them. For more information about recovering files, please, refer to https://www.easeus.com/file-recovery/re ... matically.

Catherine.
Hi , and thanks for your answer
First , all of files was created by Cad.Net absolutely
Second , we searched more in keywords you reported us , "same handle for a lot of block records"

We faced this problem because we have a file as block repository that contains about 50 common blocks and we read and add blocks to our main project file from this file . the occurred mistake was the method we add blocks to our main file that result all similar blocks had same handle .

For persons who has this problem and mistake in future , the right way for add same block twice or more is clone blocks and described in this forum post :
viewtopic.php?f=15&t=10437&p=22352&hilit=HANDLE#p22351

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: Can't open DXF file generated by cad.net

Post by support » 17 Jun 2022, 14:11

AliHatam wrote:
16 Jun 2022, 09:41
support wrote:
25 May 2022, 12:01
Hi,
I examined the files you sent. The Test1 - Error.dwg file wasn't created by either our software or AutoCAD and it contains errors, more precisely, it has a lot of blockrecords with the same name and handle, e.g.
BRANCH - $BF6F
GLOBEVALVE - $BF70
VPRESSUREGAGE - $BF71
...
Other files seem to have the same problem.
As a solution, you can open such files in AutoCAD and recover them. For more information about recovering files, please, refer to https://www.easeus.com/file-recovery/re ... matically.

Catherine.
Hi , and thanks for your answer
First , all of files was created by Cad.Net absolutely
Second , we searched more in keywords you reported us , "same handle for a lot of block records"

We faced this problem because we have a file as block repository that contains about 50 common blocks and we read and add blocks to our main project file from this file . the occurred mistake was the method we add blocks to our main file that result all similar blocks had same handle .

For persons who has this problem and mistake in future , the right way for add same block twice or more is clone blocks and described in this forum post :
viewtopic.php?f=15&t=10437&p=22352&hilit=HANDLE#p22351
Hi,
My colleague Mikhail gave an example of how to copy CADEntity. And he mentioned that this method doesn't keep the original handle value, so the developer should check the handle's uniqueness.
It means if you make a copy - you should generate new handle for this copy.

Catherine.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

jimball
Posts: 2
Joined: 12 Nov 2022, 09:01

Re: Can't open DXF file generated by cad.net

Post by jimball » 12 Nov 2022, 10:17

Thanks, Maria. The problem occurs when the file contains two block entries with the same descriptors, I fixed this on my side. Really helpful.
I did not know that the best couple of Virgo is Capricorn. According to the Virgo compatibility chart, these two are an awesome couple.

Post Reply