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:
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
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"]).ToStr
xmlsb.Append("^datasrc clipformat=\"CF_IDROP.dwg\"> " + System.Environment.NewLine);
xmlsb.Append("^datafile src=\"" + "../idropfiles/e" + Session.SessionID + ((int)Session["elevationdxfsequencenumber"]).ToStr
Response.ContentType = "text/xml";
EnableViewState = false;
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,
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!!
sir i done same as like this code but here it is showing same problam .Please see the error
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