Reading dwg file in ASP.net application

Reading dwg file in ASP.net application

erphan.wadood
Explorer Explorer
4,649 Views
4 Replies
Message 1 of 5

Reading dwg file in ASP.net application

erphan.wadood
Explorer
Explorer

I want to read dwg/dxf drawings into ASP.net C# app without starting the AutoCAD and it can run in background or side databases.
Say I have a drawing of some house with with entities of bed, bath rooms, windows, doors and some open area. I wanted to read the data like width, length and height of the rooms, windows and open/covered area etc.
What is the optimal way to achieve this? What software’s, APIs requires to achieve this.

 

Thanks,

Kyle Adams

0 Likes
Accepted solutions (1)
4,650 Views
4 Replies
Replies (4)
Message 2 of 5

ddetennis
Participant
Participant

I've used netDXF to load/read DXF files without AutoCAD or any other applications.

 

https://github.com/haplokuon/netDxf

0 Likes
Message 3 of 5

norman.yuan
Mentor
Mentor

There may be a few third party softwares for reading DXF file as @ddetennis pointed out. For Dwg, you may look into licensing RealDwg from Autodesk.

 

Or, the better option, at this cloud computing age, would be to use Autodesk's Forge cloud services. 

 

If you really want to host the DWG processing power on your own, you could use AcCoreConsole.exe which comes with AutoCAD installation, meaning you still need to run "AutoCAD" to deal with DWG file, but it is not full desktop AutoCAD, but a UI-less AutoCAD and it is what runs behind Autodesk's Forge cloud services for the same dwg data/model processing.

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 4 of 5

erphan.wadood
Explorer
Explorer

Yes, this is good option to use Autodesk's Forge cloud services instead of third party softwares or hosting the DWG processing power on our own.  By using Autodesk's Forge cloud services, we do not need a license of AutoCAD and only Forge cloud services license required for reading DWG file without AutoCAD UI. Please advise.

 

Also I was checking documentation for Autodesk's Forge cloud services. Not sure what API does our work where we have to extract the information from DWG. Could you please point me in correct API and/or samples?

 

Thanks,

0 Likes
Message 5 of 5

norman.yuan
Mentor
Mentor
Accepted solution

You would use "Design Automation API for AutoCAD" from Forge Services. See this link:

 

https://forge.autodesk.com/api/design-automation-cover-page/ 

 

It presents a tutorial of how to use the services. However, do not confuse Forge Services API with the actual drawing data process API. 

 

You still need to write your own code to access/manipulate data in DWG file, inevitably with locally installed AutoCAD, in order to debug/test the result. Once you are satisfied with it, you wrap the dwg data processing code as Forge automation API's Activity/WorkItem so that the dwg data process code can be run as Forge services, as if it is an online UI-less AutoCAD.

 

That is, as developer, you do it in two step:

1. Develop your core business logic code that deal with drawing data as if you are doing AutoCAD .NET API plug-in, and test/debug locally.

2. Publish the core business logic code to Forge's AutoCAD automation services as Activity/WorkItem, so that they can be used as services

3. Very likely, you need to build some sort of UI (web or desktop) in order to collect input for calling the services and showing the results.

 

Norman Yuan

Drive CAD With Code

EESignature