简体   繁体   中英

Convert 3D drawing to 2D drawing In Autocad Using C#

I have to convert 3D drawing to 2D drawing. So I have to create a tool to automate this.

I don't know how to start and where I can get the materials.

Please give some idea to create this tool.

I am using Autocad2007 and I have to create the tool in C#.

AutoCAD Express Tools has a method called "Flatten" that is supposed to handle this. However anyone who has actually used it knows it doesn't always get the job done.

This is certainly feasible, and you can use the in-process AutoCAD libraries natively in C# to walk through the entities. (AcMdg.dll, AcDbMdg.dll)

I would approach this by entity type. Each entity handles the z-axis differently in AutoCAD, so I'd group them into buckets beforehand and deal with them in batches. Lines are easy, as you can change the z-axis on the start and end points to 0, and polylines have an elevation if I remember correctly. 3D polylines will need each vertex walked through and set individually. Circles can have the center point set directly to z = 0... you see what I'm getting at. Go through the AutoCAD documentation and get yourself a strategy for every entity type you'll encounter.

This will get tricky with things like blocks, because then you'll have the block definition itself to deal with too. Natively 3D entities like surfaces, faces and extrusions are tougher still. You'll ultimately have to decide what can be tossed out, and what you can recreate from primitives.

If it was a simple task, AutoDesk may have already pushed something out half-decent. I think this is within your reach if you are willing to approach the problem with a strategy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM