Page 1 of 1

Can't open DXF file generated by cad.net

Posted: 05 May 2022, 16:10
by AliHatam
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

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

Posted: 06 May 2022, 12:12
by support
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

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

Posted: 07 May 2022, 07:56
by AliHatam
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 .

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

Posted: 07 May 2022, 16:49
by AliHatam
Hi Maria
I sent you an email includes sample codes we used . thanks

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

Posted: 10 May 2022, 12:34
by AliHatam
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

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

Posted: 16 May 2022, 10:49
by support
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.

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

Posted: 17 May 2022, 10:02
by AliHatam
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 ?

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

Posted: 17 May 2022, 10:54
by support
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.

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

Posted: 24 May 2022, 17:33
by AliHatam
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

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

Posted: 25 May 2022, 12:01
by support
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.

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

Posted: 16 Jun 2022, 09:41
by AliHatam
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

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

Posted: 17 Jun 2022, 14:11
by support
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.

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

Posted: 12 Nov 2022, 10:17
by jimball
Thanks, Maria. The problem occurs when the file contains two block entries with the same descriptors, I fixed this on my side. Really helpful.