If you want to use this web service on your website, you have to send me IP address of your server (server which is hosting your website).

This project (CAD Web Service) is in the test phase. You can request more CAD commands to be included. For example, now you can use RECT (rectangle),
LINE (line), BLOCK (insert block that exists in your dxf drawing which you provide to service), DIM (dimensions)...

BACK to BabaCAD home



Example of using CAD Web Service

CAD Service Input:

Use blocks from:
CAD preview size: x

CAD Service Output:

PHP code to call CAD Web Service:


<HTML>
<BODY>
...
<H4>CAD Service Output<H4>

<?php

if(isset($_GET['submit']))
{
   $client = new SoapClient('http://babacad.com/webcadviewer/cadservice.asmx?wsdl');
   $cmdstr = 'rect(0,0,100,80); rect(110,0,150,200); dim(150,0,150,200,165,100)';
   $param = array('cmds' => $cmdstr, 'w'=>400, 'h'=>300, 'prop'=>false, 'blackbg'=>false);
   $response = $client->BuildCADPreview($param);
   $answer = $response->BuildCADPreviewResult;

   if (sizeof($answer<100) && substr($answer,0,3)=='Err')
   {
     echo $answer;
   }
   else
   {
     $raw = base64_encode($answer);
     echo "<img src='data:image/gif;base64," . $raw . "' border='1' />";
   }
}
?>

</BODY>
</HTML>