8 Replies Latest reply on Apr 10, 2013 9:21 AM by Aj Jones

    Embed eDrawing in ASP.NET With UNC Path

    Aj Jones

      I found this thread from 2009, and I tried all of the suggestions, but still haven't gotten luck:

      https://forum.solidworks.com/thread/25769

       

      I have the following code to in my ASP.NET page to put an eDrawing on the webpage:

       

      <OBJECT
          align=middle
          width="800"
      height="600"
      ID="EModelViewControl"
      CLASSID="CLSID:22945A69-1191-4DCF-9E6F-409BDE94D101"> 
      <PARAM name="Filename" value= "E:\Test\Example.EASM"/>  
        <PARAM name="EnableFeatures" value="16385"/>

      </OBJECT>

       

      This works fine when it is on my computer.  When I open the webpage on another computer on our netwrok it does not load the eDrawing in the browser.  If that computer also has "E:\" mapped to the same server on our network as my computer, then it loads.  For instance E:\ is mapped as Server1 for my computer

       

      Not everyone has the location of the eDrawing mapped the same on our network.  Is there a way to do something like

      <PARAM name="Filename" value= "\\Server1\Test\Example.EASM"/>

       

      I've tried this, and I can't get it to work on my computer or any other.

      \\Server1\Test\Example.EASM is the same as E:\Test\Example.EASM on my computer yet the \\Server1 way does not work.

       

      Has anyone gotten this to work.

      I am using Internet Explorer 9

       

      Thanks,

        • Re: Embed eDrawing in ASP.NET With UNC Path
          Jacob Cordingley

          I have done this

           

          I have Edrawing embeded in an asp.net web site that points to a vitual directory

           

          have you try creating a virtual directory in IIS

          this is what i have done

          then you can go like this [Website]/[vitualdriveName}/.../Filename

          then you have to  add mime Types for all file types that you are using sldprt,sldasm,slddrw,ext..

          if you need help adding mime types let me know

            • Re: Embed eDrawing in ASP.NET With UNC Path
              Aj Jones

               

              Jacob, Thanks again for the help!  Here is the code I have currently for the ASP page:

               

              <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

              <%@ Import Namespace="SolidWorks.Interop.sldworks" %> 
              <%@ Import Namespace="SolidWorks.Interop.swconst" %>
              <%@ Import Namespace="System.Runtime.InteropServices" %>
              <%@ Import Namespace="Interop.EModelView" %>
              <%@ Import Namespace="System.ComponentModel" %>
              <%@ Import Namespace="System.Windows.Forms" %>

              <!DOCTYPE html>

              <html xmlns="http://www.w3.org/1999/xhtml">
              <head>
                  <title></title>
              </head>

                  <OBJECT

                  align=middle
                  width="800"
              height="600"
              ID="EModelViewControl"
              CLASSID="CLSID:22945A69-1191-4DCF-9E6F-409BDE94D101"> 
              <PARAM name="Filename" value= "R:/eDrawings/WWci6VLE8E.easm"/>  
                <!-- <PARAM name="Filename" value= "Server2/eDrawings/<%=Request.Params("file")%>.EASM"/> -->
                <PARAM name="EnableFeatures" value="16385"/>
              </OBJECT>

              <form id="form1" runat="server">
                     
              <SCRIPT LANGUAGE=vbscript>
                 
                 Sub FullScreen_OnClick
                   EModelViewControl.ShowFullScreen(True)
                 End Sub

                 Sub ExportEmail_OnClick
                   EModelViewControl.ShowSend()
                 End Sub

                 Sub CloseEdraw_OnClick
                   EModelViewControl.CloseActiveDoc("")
                 End Sub

              </SCRIPT>

              <body>
                  <asp:label id="Message" runat="server"/>
                  </form>
                  <FORM>
                     <input type="button" value="Full Screen" name="FullScreen"></input>
                      <input type="button" value="Export To Email" name="ExportEmail"></input>
                      <input type="button" value="Close EDrawing" name="CloseEdraw"></input>

                  </FORM>
              </body>
              </html>

               

               

               

               

               

               

               

               

               

               

              I just created a virtual directory in IIS with the Alias: "VirtualDirectoryTest" and the Physical path is: "Server2/eDrawings/"  I did a Test Settings... and both credentials past the test.  Can you tell me what I need to put in the "<PARAM name="Filename" value= "R:/eDrawings/WWci6VLE8E.easm"/>" part of the code above to call to open the eDrawing located on the server?

               

              Also I am reading up on adding the MIME types for all the file types, but as of right now I don't have that part set up yet.

               

              Thanks again for all of your help!