Merry Christmas, one and all!
21 hours ago
Adding my bit to the blogosphere. Posts on Software Development with a focus on the Revit API, C# and ASP.Net.
On the Autodesk Forums, I recently enquired about a way of replacing WHIP! for autocad, which allowed us to have an intranet with standard details for our cad users to open up, view, and if needed drag and drop into autocad.That worked fine for viewing drawings, though it was slower than our old WHIP! solution, due to the extra features it has, but it's not a big issue for us. Another problem was though, that it couldn't drag and drop the drawing into Autocad - which was the main point of the exercise. For this, we used I-Drop.<% Dim dwf
dwf = Request.QueryString("dwf")
Dim dwfxml
dwfxml = Split(dwf, "/")
Dim arraymax
arraymax = UBound(dwfxml)
dwfxml = Left(dwfxml(arraymax), Len(dwfxml(arraymax)) - 4)
dwfxml = "http://bwonline/dwf/xml/"& dwfxml & ".xml"
'response.write (dwfxml)
%>
CODEBASE=http://www.autodesk.com/global/dwfviewer/installer/DwfViewerSetup.cab#version=7,0,0,928
WIDTH="97%" HEIGHT="94%">
">
<?xml version="1.0"?>
<package xmlns="x-schema:idrop-schema.xdr">
<proxy defaultsrc="d.jpg" />
<dataset defaultsrc="L:/acad/acad_str/drg-exs/1-9.dwg" />
</package>
'Construct xml file name from dwf input string
Dim dwf
dwf = Request.QueryString("dwf")
Dim dwfxml
Dim dwfdwg
dwfxml = Split(dwf, "/")
Dim arraymax
arraymax = UBound(dwfxml)
dwfxml = Left(dwfxml(arraymax), Len(dwfxml(arraymax)) - 4)
dwfxml = "D:\Inetpub\intranet\bwo2\dwf\xml\" & dwfxml & ".xml"
dwfdwg = Left(dwf, Len(dwf) - 1) & "g"
'check if it has already been written
If Not File.Exists(dwfxml) Then
'Write xml file
Dim xmlNewDocument As XmlDocument = New XmlDocument
Dim sb As StringBuilder = New StringBuilder
sb.Append("")
sb.Append("")
sb.Append("")
sb.Append("")
sb.Append("")
xmlNewDocument.LoadXml(sb.ToString())
xmlNewDocument.Save(dwfxml)
End If
<object name="idrop" classid="clsid:21E0CB95-1198-4945-A3D2-4BF804295F78" width="15" height="15">With dwfxml variable being the generated name and location of the xml file.
<param name="background" value="background.jpg">
<param name="proxyrect" value="0,0, 15,15">
<param name="griprect" value="0, 0, 15, 15">
<param name="package" value="<% =dwfxml %>"/>
<param name="validate" value="1">
<embed width="15" height="15" background="background.jpg" proxyrect="0,0, 15,15"
griprect="0, 0, 15, 15" package="<% =dwfxml %>" validate="1" src="background.jpg" name="idrop">
</embed>
</object>