3

I have an application developed with Asp.Net and C#. I have to display DWG - CAD files(stored in a server) in a client side browser. I cannot install Auto CAD or any other software or activeX control in my client side machines and it can be installed only on the server. Is there a way to achieve it?

I have tried the DWGViewX, but it was not able to display the image when accessed from a client. But when accessed from the server itself, am able to view the DWG file. I have just tried the trial version of DWGViewX. Is this issue because of the licensing issue?

ANy help in this regard will be greatly apprecited.

Regards

Vignesh

vikky114
  • 87
  • 1
  • 1
  • 8

3 Answers3

4

Have a look at CadLib. It has an ASP.NET example solution in the evaluation download. There's also a beta version for a Silverlight 4 edition (see the forum).

Wout
  • 624
  • 5
  • 14
  • 1
    The solution under CadLib was simply converting the DWG to an image and then display it in a website. I don't think that is the best solution. Thanks for sharing though. – agarcian Apr 26 '12 at 17:52
  • 1
    @agarcian Yes this is the best and most compatible solution. To make it Svg that is more close to cad and can view by modern browser and this library can do that ! (SVG format, not bitmap as you say), is vector. +1 and this is the best answer, because this is the basic idea. – Aristos Apr 27 '12 at 08:08
  • 1
    I don't think the original question was looking for a conversion to a raster image. Not what I was looking for either when I submitted the bounty either. So, thanks for your comment, but I think this answer is not what we are looking for. – agarcian Apr 29 '12 at 01:08
  • Feel free to come up with better alternatives, I'd be curious to hear about those. – Wout Jun 20 '12 at 12:32
  • Apologies for the delayed response. We got it working with the help of DWGViewX itself. With a one month trial pack we were able to access the DWG file on the server from a client using ASP.Net. – vikky114 Sep 28 '12 at 06:30
2

First, download the free DWG TrueView from Adobe and install it.
After that open Visual Studio (I use 2008) and open a new Windows Form Project.
Then switch to the form-designer.
There you open the toolbox and add a new tab "TrueView" or so.
After that rightclick and "Choose Items..."
--> wait a couple of seconds
--> then choose the tab "COM Components"
--> there you should find "Autodesk AcCtrl" mark it.

Now you have a component "Autodesk AcCtrl" in your "TrueView" Toolbox --> use it on the form.

and now, very simple, you need only one line of code in the Form1_Load function (generated through Visual Source) and put the following code in it:

axAcCtrl1.PutSourcePath(@"C:\WHERE\EVER\YOUR\DWG\FILE\IS\example.dwg");

Thats all!

Hope it helped!

rruza
  • 21
  • 1
  • This seems to be an ActiveX control, that means it only works on IE and Firefox (with an additional plugin). Isn't that the case? – agarcian Apr 30 '12 at 18:58
0

If you want your end users, without having autocad or any compatable viewer for dwg files, then you need to convert dwg drawings to pdf or jpg. There are some libraries available in web to accomplish that. See the below url:

http://www.codeproject.com/Questions/103830/convert-from-dwg-to-pdf

MUG4N
  • 19,377
  • 11
  • 56
  • 83