Click here to Skip to main content
15,880,543 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I don't know much about CAD files or the Autocad prorietary file format of DWG.

I would like to understand how I can work with this format. Ideally, I want to be able to take a dwg file, search for a particular named object and then render a flat jpeg image and draw a circle around that object.

The files would be flat floor plans that have been marked up with desks. I would like to create n amount of images of the floor plan, where n is the amount of desk objects. Essentially making a bunch of unique "Desk is here!" images for each, where the floor plan is one image, but potentially hundreds of flat images will be made off of it.

I am very familiar with getting files, system.drawing.image, system.drawing.graphics and actually resizing the images, drawing on them and saving files out, but I have never had to work with AutoCAD files. Can anyone offer any help?

What I have tried:

using (var srcImage = Image.FromFile(file.FullName.ToString()))
<-- For the image drawing afterwards
Posted
Comments
The Other John Ingram 10-Sep-21 13:57pm    
if you google autocad dwg file layout you will find a file layout of the file.
at first look it looks like a project in it self just to read this file.
Also it looks like its proprietary to autocad and the layout is by a 3 party and might not be up to date.
RedDk 10-Sep-21 19:47pm    
Here at CP there are a few available articles that might be worth looking at:
https://www.codeproject.com/search.aspx?q=DWG&x=11&y=4&sbo=kw&usfc=false

DXF and DWG files are indeed proprietary formats but they are well documented and more than enough information about their structures is readily available on the internet.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900