Page 1 of 1

ASP.NET Demo not rendering Sample.dwg

Posted: 05 May 2011, 14:00
by pateketu
Hello

I just downloaded the trial version of CADImport.NET and trying out the ASP.NET Demo, the demo runs but it only generates a blank image, see the Image file it generates, I have also tried using a different dwg file but the result is same

I have debugged through the code and no errors are generated

Any ideas?

Thanks
Ketul

Re: ASP.NET Demo not rendering Sample.dwg

Posted: 05 May 2011, 17:04
by support
Hello.
We have tested the described issue with the latest release version (7.2.7). The result looks correct. Have you tried import the file in any other form based demo application? You can send the file to support@cadsofttools.com for the testing.

Alexander.

Re: ASP.NET Demo not rendering Sample.dwg

Posted: 05 May 2011, 17:26
by pateketu
DWG file, I am using is the Sample.dwg file that was in your ASPNETDemo, The file works correctly on the Viewer demo, do you still need the dwg file?

Re: ASP.NET Demo not rendering Sample.dwg

Posted: 05 May 2011, 19:25
by pateketu
never mind it needs the full path of the image file C:\......\sample.dwg and not just sample.dwg as defaulted in the textbox

Re: ASP.NET Demo not rendering Sample.dwg

Posted: 06 May 2011, 12:23
by support
Hello.
The ASP.NET demo project generates correct image if file name specified with the path like shown on screen shot. You can also add the following conditional code into Default.aspx.cs module to import files from "server":

Code: Select all

    public Errors OpenFile(string inFileName, string outFileName, double left, double top, double width, double height)
    {
        try
        {
            cadImage = CADImage.CreateImageByExtension(inFileName);
            if (cadImage == null)
                return Errors.UNIDENTIFIED_ERROR;

            // addition:
            if (Path.GetFileName(inFileName) == inFileName)
            {
                string realPath = this.MapPath("") + "\\";
                realPath += inFileName;
                inFileName = realPath;
            }
            // end of addition
            ...
Alexander.