• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    i-drop Enhancer Extension Developer

    Reply
    Active Member
    Posts: 8
    Registered: ‎01-14-2008

    dynamic idrop content, I'm so close but the last step is eluding me

    1182 Views, 5 Replies
    01-14-2008 12:01 PM
    Hello,
    I've been fighting with idrop for several days now, and I am oh so close to having fully dynamic idrop content working. However, the lack of any real documentation from autodesk has elft me scratching my head on the last part of it.

    Summary of the situation:
    I'm working on a configuration website. Customers go to the site, pick from a host of options, and are shown the final product. The whole site is done, and It generates DXF files of their finished product on the fly perfectly. What I'm trying to do here is set up idrop so they can directly drop these drawings into autocad.

    I already have the package XMLs being generated correctly. In the page itself where you block out the idrop object, I have:



    When the page loads, it hits that URL thinking it's getting a physical XML file, but it's really an ASP.NET code page that returns the appropriate xml data with a response type of text/xml.
    NOTE: The idrop control will not even try to access your web code unless you wnd the package value URL with ".xml", so just slap it on the end and deal with it in your ASP/PHP/whatever code.

    Everything above works correctly. The problem comes at the last step. I try to do almsot the same thing in the package XML that I give the control; I set the datafile src element like so:


    When I go and try to idrop into DWG trueview from the page, it does access the code, and a DXF file is definately generated and sent back as a response with mime type application/dxf, but DWG true view has a fit and says "can't find file xxx in search path".


    I noticed some strange behavior though when I use packet and HTTP sniffing tools; when I try to idrop the sample page from autodesk, IE is the process doing the heavy lifting (getting the dxf file via HTTP get request). However when I try to access my dynamic URL to return a DXf, DWG True View itself is actually making the HTTP GET request.

    I have tried everything I could think of to try to match the header data and "fool" idrop into thinking it is looking for a physical file, but to no avail so far. That is why I came to this messageboard. Maybe one of you can help me or at least shine a little more light on the problem, and hopefully I can be of at least some help to you as well (I see there are a number of threads on here looking for help setting up dynamic package files for use in idrop, which I have working fine).

    Thanks,
    Dave
    Please use plain text.
    Distinguished Contributor
    Posts: 190
    Registered: ‎09-23-2003

    Re: dynamic idrop content, I'm so close but the last step is eluding me

    01-15-2008 06:19 AM in reply to: dmosinee
    Can you post your XML file?

    If I see the file I can help you.

    Sem
    Please use plain text.
    Active Member
    Posts: 8
    Registered: ‎01-14-2008

    Re: dynamic idrop content, I'm so close but the last step is eluding me

    01-15-2008 11:14 AM in reply to: dmosinee
    Hi, good to see a response,
    So since my posting yesterday I learned a bit more about how idrop works, and what its limitations are.

    The problem I was having yesterday is with the way DWG True View and Autodesk (I was using 2008) actually handle idrop content. What they do is grab the source data from the internet using their own HTTP GET agent. Then they write that data out to a temp file it creates in your temporary internet files, below is an example of one I observed it creating with filemon:

    C:\Documents and Settings\dmosinee\Local Settings\Temporary Internet
    Files\Content.IE5\R5OQ88QV\test[1].dxf

    The naming convention it uses is very particular. It ignores the actual name of the file, and names it according to whatever you have entered in your package xmlfile with a [#] at the end (presumably in case multiple files are requested with the same name, more on that later). It then opens that file using its normal routines and inserts the data as it normally would.

    The problem I was having was with how it ignores the actual name of the returned file and just names its temporary file according to what is entered in the package xml; so in my case the temp file was coming out as an aspx page.

    I solved this problem by simply renaming my aspx page from getdxfdrawing.aspx to getdxfdrawing.dxf, and used a custom HTTPhandler in my ISS web.config file to instruct the server to treat *.dxf files the same way they would *.ASPX files.

    At this point the whole thing actually worked! but I discovered a new problem, again with the way DWG True View and Autocad (2008) handle idrop content. When you idrop some content into either application, it decides to do its own internal caching of the location/data, I'm not sure why. So once you've idropped something from a particular URL into an active drawing, the software won't even look for there to be any new/different data at that same URL if you idrop again, It will just slap the same exact content in.

    With more work I think I have solved even that problem by building my package XML files to have drawing URLs containing unique information in the URL itself. This was complicated to set up, but suffice to say idrop now passes on to the app a URL that hits the DXF generating page with the users session ID and a sequence number as the filename for the DXF file.

    This seems to have worked for the most part, but sometimes I still receive the dreaded "could not find * in search path" error, despite my constantly changing dxf file names. It almost seems to me like the idrop OCX control itself has some kind of ID that is passed to the application, and something is getting cached so that autocad isn't getting the results of the constantly changing package.xml.

    As per your request, here is the code I use to generate the XML files, this is part of an aspx codebehind:
    [NOTE: I have replace the '<' character with the '^' character in the below code to make it show up on this forum]

    StringBuilder xmlsb = new StringBuilder();
    xmlsb.Append("^?xml version=\"1.0\"?>" + System.Environment.NewLine);
    xmlsb.Append("^package xmlns=\"x-schema:../idrop-schema.xml\"> " + System.Environment.NewLine);
    xmlsb.Append("^proxy defaultsrc=\"../images/idrophandle.gif\">^/proxy> " + System.Environment.NewLine);

    xmlsb.Append("^dataset defaultsrc=\"" + "../idropfiles/e" + Session.SessionID + ((int)Session["elevationdxfsequencenumber"]).ToString() + ".dxf" + "\">" + System.Environment.NewLine);

    xmlsb.Append("^datasrc clipformat=\"CF_IDROP.dwg\"> " + System.Environment.NewLine);

    xmlsb.Append("^datafile src=\"" + "../idropfiles/e" + Session.SessionID + ((int)Session["elevationdxfsequencenumber"]).ToString() + ".dxf" + "\"/>" + System.Environment.NewLine);

    xmlsb.Append("^/datasrc>");
    xmlsb.Append("^/dataset>");
    xmlsb.Append("^/package>");




    Response.ContentType = "text/xml";
    EnableViewState = false;

    Response.Write(xmlsb.ToString());
    Response.End();
    Please use plain text.
    Active Member
    Posts: 8
    Registered: ‎01-14-2008

    Re: dynamic idrop content, I'm so close but the last step is eluding me

    01-15-2008 11:35 AM in reply to: dmosinee
    TRIUMPH! I just got it to work correctly!

    My last problem in the above wall of text was caused by the fact that I forgot about the custom HTTP handler I put in place earlier. It needed to be altered to play nice with the stuff I put in to pass data around inside the base URL.

    Thank the lord that I now have this whole mess cobbled together. If anyone comes along trying to do a similar thing, post here and I will try to help you; as I wouldn't wish these idrop headaches on my worst enemy. I really don't see why autodesk has completely abondoned this would-be powerful tool. Sure they don't sell it directly, but if web developers make sites and apps using it, it creates pressure on end users to buy autocad instead of some other design package (as autodesk users will be the only ones to get the full functionality). If anyone from autodesk reads this: I'm beggin you, please, either start supporting your fine product or release the full API specs so we developers can create our own tools to interact with your software.

    Thanks for the earlier input sem,
    Dave
    Please use plain text.
    Distinguished Contributor
    Posts: 190
    Registered: ‎09-23-2003

    Re: dynamic idrop content, I'm so close but the last step is eluding me

    01-16-2008 12:27 PM in reply to: dmosinee
    Good to hear that it works.

    Can you write the link and will visit your work?

    On the other hand the way you did it is different with i-drop works. Ie it is not necessary to convert it to DXF file and the XML file that you post is different with the XML file that works on I-Drop.

    The XML file is a mid point for AutoCAD and Internet explorer.
    You assign the value of the parameters in XML file and it works.

    OK if it works for AutoCAD in DXF flies how about Inventor? 3D Studio MAX or other aplications?

    Any how it works for what you were look and Good job!!

    Sem
    Please use plain text.
    New Member
    Posts: 1
    Registered: ‎03-05-2012

    Re: dynamic idrop content, I'm so close but the last step is eluding me

    03-05-2012 09:24 PM in reply to: dmosinee

    sir i done same as like this code but here it is showing same problam .Please see the error

     

    File C:\Users\rajiv.kumar\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\GN6XSBD3\chair[1].dwg was created by an incompatible version

    i m using vs2010(asp.net with c#). Please help me to solve folowing problam in am inplementing chair exaple through 2010 . please  provide me sample code page

    Please use plain text.