Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View DWG files in a browser

Tags:

c#

asp.net

dwg

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

like image 535
vikky114 Avatar asked Sep 17 '25 06:09

vikky114


2 Answers

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).

like image 176
Wout Avatar answered Sep 19 '25 20:09

Wout


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!

like image 42
rruza Avatar answered Sep 19 '25 21:09

rruza