.NET

Reply
Active Member
sandeep_vaal
Posts: 6
Registered: ‎06-24-2013
Message 1 of 3 (415 Views)
Accepted Solution

Unable to read the attached DXF using Database.DXFIn()

415 Views, 2 Replies
06-24-2013 04:11 AM

Hi,

 

I am new to the RealDWG. I am trying to read the dxf file using RealDWG. Most of the files do come in correctly. But there are some files where DXFIn() api just hangs. It does not throw any error or comes out of the API call, but simply hangs. 

 

If I Open and then Save the attached file in latest AutoCAD(AutoCAD 14) in dxf format only then DXFIn function executes properly. 

 

It looks like the version compatibility issue of dxf files. But what I am interested in is that how should I figure out which files needs to be resaved before my application hangs.

 

Here is the code I am using.

 

this.database = new Database(false/*build empty object*/, true/*assiciate this database to current document*/);

public void ReadFile(string fileName)

{

string fileExt = Path.GetExtension(fileName);
if(fileExt.Equals(".dxf", StringComparison.InvariantCultureIgnoreCase))
this.database.DxfIn(fileName, this.logFilePath);
else
this.database.ReadDwgFile(fileName, FileOpenMode.OpenForReadAndReadShare, false /*allowCPConversion*/, string.Empty/*password*/);

.

.

.

.

 

}

 

Thanks,

Sandeep

The fact that the DXF file loads fine in AutoCAD suggests to me that you have a problem in your RealDWG application implementation. Have you used this template as the basis for your RealDWG app? http://adndevblog.typepad.com/autocad/2012/05/fentons-recommended-hostapplicationservices-implementation-for-realdwg-net.html

 

Another point... As with any code that processes many data files; I recommend that your RealDWG app is hosted in a separate exe that your processor app exe, this is so your processor app can monitor the health of your separate RealDWG exe app in case of failure, so that your program stays up.

ADN Support Specialist
fenton.webb
Posts: 352
Registered: ‎07-24-2007
Message 2 of 3 (396 Views)

Re: Unable to read the attached DXF using Database.DXFIn()

06-24-2013 10:05 AM in reply to: sandeep_vaal

The fact that the DXF file loads fine in AutoCAD suggests to me that you have a problem in your RealDWG application implementation. Have you used this template as the basis for your RealDWG app? http://adndevblog.typepad.com/autocad/2012/05/fentons-recommended-hostapplicationservices-implementa...

 

Another point... As with any code that processes many data files; I recommend that your RealDWG app is hosted in a separate exe that your processor app exe, this is so your processor app can monitor the health of your separate RealDWG exe app in case of failure, so that your program stays up.





Fenton Webb

Developer Technical Services

Autodesk Developer Network


Active Member
sandeep_vaal
Posts: 6
Registered: ‎06-24-2013
Message 3 of 3 (371 Views)

Re: Unable to read the attached DXF using Database.DXFIn()

06-24-2013 10:44 PM in reply to: fenton.webb
Hi,



Thanks for the reply. The template solved my problem



Thanks again for the reply.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!