Click here to Skip to main content
15,947,472 members
Please Sign up or sign in to vote.
1.89/5 (4 votes)
See more:
hi friends....can anyone give me ideas on how to implement "viewing autocad(3d file) in windows forms application using .net" without installing autocad software.
thanks in advance
Posted
Updated 11-Feb-15 22:03pm
v2

Hi there, I wrote something in WPF a few months ago...
You can find it here: WpfDxfViewer
.
 
Share this answer
 
Comments
Kenneth Haugland 10-Feb-15 9:53am    
That is very cool stuff, but what can and cant it read? Dxf version 2012 2014 etc?
Riyaz Mohammad 10-Feb-15 23:51pm    
Hi Danilo Corallo,
Thanx for quick reply and solution. Can we develope same application in simple window forms in .net not using wpf?

Thanx advance
Danilo Corallo 11-Feb-15 10:01am    
Hi Kenneth, I've done it with Windows Forms and GDI+ prior to move to WPF...
I need to look if I can find it back...
Kenneth Haugland 5-May-15 14:56pm    
Hah, I didn't see this until now. You answered the ops comment instead of mine ;)
In any rate, I'm writing a SimpleCAD article, so I'd thought I include imports from Shape and DXF files. However its a lot of work...
Hi,
I've been using DXFLib for DXF parsing (available here).

I think it can read correctly any DXF from 2007 to 2012...

The graphic part is incomplete, I've been handling the basic entities (line, polyline, arc, circle,...) but the list is quite long. I actually use it in my apps after cleaning and exploding my drawings (ACAD commands EXPLODE and PURGE)

Take it as a starting point, it's not a CAD neither is a complete project.
Kind Regards,
D.
 
Share this answer
 
Comments
Riyaz Mohammad 11-Feb-15 0:10am    
Hi Danilo Corallo,
I am trying to run your "WpfDxfViewer" application using WPF.But i am geeting error in "MainWindow.xaml" page.

errors:
Error 1 The tag 'ZoomableCanvas' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'. Line 43 Position 14.

Error 2 The type 'ZoomableCanvas' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.

How can i resolve it?

Thanx Advance.
Danilo Corallo 11-Feb-15 10:00am    
ZoomableCanvas is included in the solution. You may need to remove and add the reference from the project in order to fix it.
Riyaz Mohammad 12-Feb-15 0:33am    
i tried same way but again same problem is coming. In order to add a "ZoomableCanvas" reference that reference dll not included in your project files. How could i solve this issue. One more thing i have to tell while starting the project i tried to open your project directly. but it's not opened some error came. So i make new WPF application and adding all your files. finally i am struck at this point.
Will you Please try to solve this issue? if need means i ll send full project.

Thanking you
Riyaz Mohammad 12-Feb-15 0:43am    
One more thing..i checked in "Obect Browser" for "ZoomableCanvas" class. It's showing in "System.Windows.Controls.ZoomableCanvas". I add "System.Windows.Controls.dll" but showing error is 'Cannot resolve dependency to assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event' like that.
Danilo Corallo 12-Feb-15 3:57am    
Hi, I've just downloaded the solution from GitHub as it is, and it compiles with no problem, no problem in references. I'm using VS2013 and project requires .NET Framework 4.5.1. ZoomableCanvas is correctly included in source code (no DLL), and while it uses a namespace which extends System.Windows.Controls, it's NOT included in System.Windows.Controls.dll. Finally ZoomableCanvas is an external component which I've taken from here.

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