Extracting Metadata from DWG Files in a .NET MVC Web Application

Extracting Metadata from DWG Files in a .NET MVC Web Application

bradengpt
Explorer Explorer
1,432 Views
5 Replies
Message 1 of 6

Extracting Metadata from DWG Files in a .NET MVC Web Application

bradengpt
Explorer
Explorer

I am planning to develop a .NET MVC web application that can calculate the required quantities of various materials based on square footage or structural dimensions. The goal is to obtain accurate calculations for each room, stairs, roof, and foundation.

I have the following questions:
1. Is the necessary data available within the metadata and properties of DWG files?
2. What is the most effective approach to extract this data using .NET?

I would appreciate any guidance, sample code, or recommended libraries for efficiently accessing and processing this information.

Thank you!

0 Likes
Accepted solutions (1)
1,433 Views
5 Replies
Replies (5)
Message 2 of 6

norman.yuan
Mentor
Mentor

To extract data from DWG file, you need run AutoCAD (locally, or remotely with Autodesk's cloud services) with your custom AutoCAD plugin (or whatever plugin developed by third parties. The data extracting process DOES NOT run inside your web application. That is, your web app is just a server side operation that spawns the DWG data extracting process and collects the extracted data for the users.

 

It is very possible that you would use Autodesk's cloud service for the data extracting, or you can run AutoCAD's core console EXE (a no-UI AutoCAD on your server, if you host your web app inside your intranet). Either way, you need to be able to develop a data extracting plugin for AutoCAD (or find someone who can do it for you, so that you can focus on the web app for the operation workflow).

 

It sounds to me that you are not very familiar to AutoCAD .NET plugin development. To get the data as your showed from a drawing file, it would be quite long/steep learning curve, and you need to have decent AutoCAD using/AutoCAD programming knowledge. I'd say, the development of your project should have a 2-person team: someone who does AutoCAD plugin programming very well (and may or may not know web app development well) and the other (maybe, you) who knows web app development well (so it would not be difficult to take advantage of/integrate Autodesk's cloud services into the web app), who does not need to know AutoCAD plugin development much.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 6

ActivistInvestor
Mentor
Mentor
Accepted solution

AutoCAD drawing files do not contain rooms, stairs, roofs, or foundations. AutoCAD drawing files contain primitive geometry (lines, circles, etc.) that can be used to visually-represent those things but there is no formal definition of them. That means you must interpret the geometry to be one of those things or something else which is not a trivial matter.

 

IOW, AutoCAD is not a BIM application that creates fully-defined models of buildings. That would be something you would obtain from files produced by Revit or from another model-based software. 

0 Likes
Message 4 of 6

bradengpt
Explorer
Explorer

Thank you for your detailed response, Norman.Yuan.

I agree with your point about utilizing Autodesk's cloud services for data extraction. I have previously worked with the Model Derivative API to extract metadata from RVT files.

I am currently exploring whether it is possible to extract this data using the .NET SDK — specifically the Autodesk.ModelDerivative.Model.Namespace.

If you have any insights or recommendations regarding the best approach to achieve this using Autodesk Platform Services (APS), I would greatly appreciate your guidance.

Thank you!

0 Likes
Message 5 of 6

bradengpt
Explorer
Explorer

Thanks for your reply, ActivistInvestor

I agree with you, but I badly want to extract that kind of detailed information from a DWG file, It may look silly but hope you understand me ‌‌😅

Is there any way to convert DWG file to RVT file?

My ultimate goal is to generate a comprehensive list of real-world materials—such as those available in warehouses or at suppliers like Home Depot—based on accurate dimensions. I believe using an RVT file could help achieve this since it provides more precise and structured data.

If you have any insights, suggestions, or methods to accomplish this, I would genuinely appreciate your guidance.

Thank you in advance for your help.

0 Likes
Message 6 of 6

johni_douglas_marangon
Community Visitor
Community Visitor

@bradengpt I have same challenge here.

I am looking for a way to identify objects and calculate the required quantities of various materials.

What do you think to talk about it?

0 Likes