DWF Viewer (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 8
Anonymous
548 Views, 7 Replies

DWF with ASP

To all

Have run into a roadblock and was wondering if I could get inspiration from
the group. I have an ASP file that has 2 frames located on it. There is
the master frame header page called h1.asp, left.asp and right.asp. On the
right frame is a list of area (directories) When one is selected the left
frame shows a list of files (DWF's) located within. When the person selects
the DWF file to view then that opens in the left frame.
The question I have is how can I send the name of the file the user selected
to the left window as a variable to show what is being viewed.

Tried session variable but not sure what to pass after the selection. Any
pointers??

Shawn Romkey
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous

Have you tried sending it as a parameter on the command line such as
left.asp?fileselected=filename.dwf In you ASP, you can get the parameter
from the querystring.

"SHawn" wrote in message
news:E2715A4C3F0F188DB465F5389F238A6B@in.WebX.maYIadrTaRb...
> To all
>
> Have run into a roadblock and was wondering if I could get inspiration
from
> the group. I have an ASP file that has 2 frames located on it. There is
> the master frame header page called h1.asp, left.asp and right.asp. On
the
> right frame is a list of area (directories) When one is selected the left
> frame shows a list of files (DWF's) located within. When the person
selects
> the DWF file to view then that opens in the left frame.
> The question I have is how can I send the name of the file the user
selected
> to the left window as a variable to show what is being viewed.
>
> Tried session variable but not sure what to pass after the selection. Any
> pointers??
>
> Shawn Romkey
>
>
Message 3 of 8
tojonas
in reply to: Anonymous

Hi,

When I add ANYTHING to the querystring I get the following error: CAdEPlotDocument::LoadStream : 595.
And when I look at the GET request sent from the viewer it doesn't contain the query string part (See thread Problem streamin DWG file).

So is this something you know about or is it only me having these problems?

Thanks in advance!
/Jonas
Message 4 of 8
Anonymous
in reply to: Anonymous

John

Thanks for the reply.

Are you saying that the line that opens the DWF file. I tried putting it
there but it just opens a second frame beside the first frame. It has the
variable so I can display it but now I have two left.asp frames, one with
the name and the original without the name. If I then refresh it keeps the
original frame but not the one with the file name displayed. Maybe my
structure is wrong??

Again, any further info or a location where I could find something
similar????

Shawn

"John Schmier (Autodesk)" wrote in
message news:3D87457943B23FAD946B1887E5993EF9@in.WebX.maYIadrTaRb...
> Have you tried sending it as a parameter on the command line such as
> left.asp?fileselected=filename.dwf In you ASP, you can get the parameter
> from the querystring.
>
> "SHawn" wrote in message
> news:E2715A4C3F0F188DB465F5389F238A6B@in.WebX.maYIadrTaRb...
> > To all
> >
> > Have run into a roadblock and was wondering if I could get inspiration
> from
> > the group. I have an ASP file that has 2 frames located on it. There
is
> > the master frame header page called h1.asp, left.asp and right.asp. On
> the
> > right frame is a list of area (directories) When one is selected the
left
> > frame shows a list of files (DWF's) located within. When the person
> selects
> > the DWF file to view then that opens in the left frame.
> > The question I have is how can I send the name of the file the user
> selected
> > to the left window as a variable to show what is being viewed.
> >
> > Tried session variable but not sure what to pass after the selection.
Any
> > pointers??
> >
> > Shawn Romkey
> >
> >
>
>
Message 5 of 8
Anonymous
in reply to: Anonymous

It's sounding like I'm not understanding the problem fully here.

As I understand it, you have 3 frames, the left frame is a directory
browser. when the user clicks on a link in this frame you want to send a
parameter to that frame (and that frame only) about what they selected.

Based on this last message, it sounds like you may want to do something
different from my understanding. If you want to send that parameter to more
than one frame, lets take for example the left frame is to have the file
name for updating the directory, and the right frame would be the DWF
control, then you may be able to handle this with some javascript, that
would update the right frame first (update the source of the frame) and then
send update itself. Or you could update the entire frameset at the _top
level with a set of parameters are rebuild all 3 windows within the
frameset.



"SHawn" wrote in message
news:5005ED14A9C6015377F7E74E95505235@in.WebX.maYIadrTaRb...
> John
>
> Thanks for the reply.
>
> Are you saying that the line that opens the DWF file. I tried putting it
> there but it just opens a second frame beside the first frame. It has the
> variable so I can display it but now I have two left.asp frames, one with
> the name and the original without the name. If I then refresh it keeps the
> original frame but not the one with the file name displayed. Maybe my
> structure is wrong??
>
> Again, any further info or a location where I could find something
> similar????
>
> Shawn
>
> "John Schmier (Autodesk)" wrote in
> message news:3D87457943B23FAD946B1887E5993EF9@in.WebX.maYIadrTaRb...
> > Have you tried sending it as a parameter on the command line such as
> > left.asp?fileselected=filename.dwf In you ASP, you can get the
parameter
> > from the querystring.
> >
> > "SHawn" wrote in message
> > news:E2715A4C3F0F188DB465F5389F238A6B@in.WebX.maYIadrTaRb...
> > > To all
> > >
> > > Have run into a roadblock and was wondering if I could get inspiration
> > from
> > > the group. I have an ASP file that has 2 frames located on it. There
> is
> > > the master frame header page called h1.asp, left.asp and right.asp.
On
> > the
> > > right frame is a list of area (directories) When one is selected the
> left
> > > frame shows a list of files (DWF's) located within. When the person
> > selects
> > > the DWF file to view then that opens in the left frame.
> > > The question I have is how can I send the name of the file the user
> > selected
> > > to the left window as a variable to show what is being viewed.
> > >
> > > Tried session variable but not sure what to pass after the selection.
> Any
> > > pointers??
> > >
> > > Shawn Romkey
> > >
> > >
> >
> >
>
>
Message 6 of 8
Anonymous
in reply to: Anonymous

John

Best way to show you is to post the ASP files and the links. Basically the
left frame is static and never changes. It is a link of a series of
directories. The files in those directoroes chances so when the user
selects the directory to view a list shows up in the right frame. The user
can then select the DWF to view, which appears in the same frame (the right
one). The problem is that I want the user to see the current name of the
file just selected in the left frame at the bottom of the list of
directories. My thought was to past the name of the selected drawing up to
the header frame with a querystring and then read that with the left frame.
The problem is setting the variable (names "ID") that then can be read by
the request.querystring option?

I don't know how else to describe it. Have a look at the attached files and
maybe it will be a little clearer!


--
Shawn Romkey P.Geo
Noranda Mining

"John Schmier (Autodesk)" wrote in
message news:43B521148C06949F9010B4AE7477784B@in.WebX.maYIadrTaRb...
> It's sounding like I'm not understanding the problem fully here.
>
> As I understand it, you have 3 frames, the left frame is a directory
> browser. when the user clicks on a link in this frame you want to send a
> parameter to that frame (and that frame only) about what they selected.
>
> Based on this last message, it sounds like you may want to do something
> different from my understanding. If you want to send that parameter to
more
> than one frame, lets take for example the left frame is to have the file
> name for updating the directory, and the right frame would be the DWF
> control, then you may be able to handle this with some javascript, that
> would update the right frame first (update the source of the frame) and
then
> send update itself. Or you could update the entire frameset at the _top
> level with a set of parameters are rebuild all 3 windows within the
> frameset.
>
>
>
> "SHawn" wrote in message
> news:5005ED14A9C6015377F7E74E95505235@in.WebX.maYIadrTaRb...
> > John
> >
> > Thanks for the reply.
> >
> > Are you saying that the line that opens the DWF file. I tried putting
it
> > there but it just opens a second frame beside the first frame. It has
the
> > variable so I can display it but now I have two left.asp frames, one
with
> > the name and the original without the name. If I then refresh it keeps
the
> > original frame but not the one with the file name displayed. Maybe my
> > structure is wrong??
> >
> > Again, any further info or a location where I could find something
> > similar????
> >
> > Shawn
> >
> > "John Schmier (Autodesk)" wrote
in
> > message news:3D87457943B23FAD946B1887E5993EF9@in.WebX.maYIadrTaRb...
> > > Have you tried sending it as a parameter on the command line such as
> > > left.asp?fileselected=filename.dwf In you ASP, you can get the
> parameter
> > > from the querystring.
> > >
> > > "SHawn" wrote in message
> > > news:E2715A4C3F0F188DB465F5389F238A6B@in.WebX.maYIadrTaRb...
> > > > To all
> > > >
> > > > Have run into a roadblock and was wondering if I could get
inspiration
> > > from
> > > > the group. I have an ASP file that has 2 frames located on it.
There
> > is
> > > > the master frame header page called h1.asp, left.asp and right.asp.
> On
> > > the
> > > > right frame is a list of area (directories) When one is selected the
> > left
> > > > frame shows a list of files (DWF's) located within. When the person
> > > selects
> > > > the DWF file to view then that opens in the left frame.
> > > > The question I have is how can I send the name of the file the user
> > > selected
> > > > to the left window as a variable to show what is being viewed.
> > > >
> > > > Tried session variable but not sure what to pass after the
selection.
> > Any
> > > > pointers??
> > > >
> > > > Shawn Romkey
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Message 7 of 8
Anonymous
in reply to: Anonymous

Ok, I now understand (I hope) your problem and have worked up some sort of
solution. The problem from what I can understand of it doesn't have to do
with the DWF, more of a hyperlink / coding issue. Here's my solution (I've
attached 2 of your files that I altered to come up with the solution).

In the left frame (contents.asp), I added a Form with a text field. This is
where the file name will be presented to the user when they click on a dwf
link in the right frame.

In the right frame (Prints.asp) after the user has selected a project (for
example the 425 level) I have added a bit of JavaScript code to the top:
function SelectedLink(path, filename){
top.frames('contents').document.forms('Messages').SelFileName.value =
filename;
top.frames('main').location.href = path + '/' + filename;
}

As well as altered the code where the link is written out:
JavaScript:SelectedLink('" & dirc & "', '" & fnames(i) & "')

Now, what will happen is when the user clicks on one of these special links,
the link call the JavaScript function and pass the directory and filename
separately, the JavaScript Function will then update the left frame's form
with the proper text, and then change the url of the main page to the
document requested.

I hope I understood the problem correctly.

"Shawn Romkey" wrote in message
news:17C38BD898CE4AD20D1E52EC9DBB59A1@in.WebX.maYIadrTaRb...
> John
>
> Best way to show you is to post the ASP files and the links. Basically
the
> left frame is static and never changes. It is a link of a series of
> directories. The files in those directoroes chances so when the user
> selects the directory to view a list shows up in the right frame. The
user
> can then select the DWF to view, which appears in the same frame (the
right
> one). The problem is that I want the user to see the current name of the
> file just selected in the left frame at the bottom of the list of
> directories. My thought was to past the name of the selected drawing up
to
> the header frame with a querystring and then read that with the left
frame.
> The problem is setting the variable (names "ID") that then can be read by
> the request.querystring option?
>
> I don't know how else to describe it. Have a look at the attached files
and
> maybe it will be a little clearer!
>
>
> --
> Shawn Romkey P.Geo
> Noranda Mining
>
> "John Schmier (Autodesk)" wrote in
> message news:43B521148C06949F9010B4AE7477784B@in.WebX.maYIadrTaRb...
> > It's sounding like I'm not understanding the problem fully here.
> >
> > As I understand it, you have 3 frames, the left frame is a directory
> > browser. when the user clicks on a link in this frame you want to send
a
> > parameter to that frame (and that frame only) about what they selected.
> >
> > Based on this last message, it sounds like you may want to do something
> > different from my understanding. If you want to send that parameter to
> more
> > than one frame, lets take for example the left frame is to have the file
> > name for updating the directory, and the right frame would be the DWF
> > control, then you may be able to handle this with some javascript, that
> > would update the right frame first (update the source of the frame) and
> then
> > send update itself. Or you could update the entire frameset at the _top
> > level with a set of parameters are rebuild all 3 windows within the
> > frameset.
> >
> >
> >
> > "SHawn" wrote in message
> > news:5005ED14A9C6015377F7E74E95505235@in.WebX.maYIadrTaRb...
> > > John
> > >
> > > Thanks for the reply.
> > >
> > > Are you saying that the line that opens the DWF file. I tried
putting
> it
> > > there but it just opens a second frame beside the first frame. It has
> the
> > > variable so I can display it but now I have two left.asp frames, one
> with
> > > the name and the original without the name. If I then refresh it keeps
> the
> > > original frame but not the one with the file name displayed. Maybe
my
> > > structure is wrong??
> > >
> > > Again, any further info or a location where I could find something
> > > similar????
> > >
> > > Shawn
> > >
> > > "John Schmier (Autodesk)" wrote
> in
> > > message news:3D87457943B23FAD946B1887E5993EF9@in.WebX.maYIadrTaRb...
> > > > Have you tried sending it as a parameter on the command line such as
> > > > left.asp?fileselected=filename.dwf In you ASP, you can get the
> > parameter
> > > > from the querystring.
> > > >
> > > > "SHawn" wrote in message
> > > > news:E2715A4C3F0F188DB465F5389F238A6B@in.WebX.maYIadrTaRb...
> > > > > To all
> > > > >
> > > > > Have run into a roadblock and was wondering if I could get
> inspiration
> > > > from
> > > > > the group. I have an ASP file that has 2 frames located on it.
> There
> > > is
> > > > > the master frame header page called h1.asp, left.asp and
right.asp.
> > On
> > > > the
> > > > > right frame is a list of area (directories) When one is selected
the
> > > left
> > > > > frame shows a list of files (DWF's) located within. When the
person
> > > > selects
> > > > > the DWF file to view then that opens in the left frame.
> > > > > The question I have is how can I send the name of the file the
user
> > > > selected
> > > > > to the left window as a variable to show what is being viewed.
> > > > >
> > > > > Tried session variable but not sure what to pass after the
> selection.
> > > Any
> > > > > pointers??
> > > > >
> > > > > Shawn Romkey
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



<%@ LANGUAGE="VBScript" %>



Current Production Drilling Prints





Current Production Drilling Prints







<%
dirc = request ("dirc")
response.write ("
color=""#3300cc"" size=""5"">
Mine Engineering Production
Drilling Prints

" & dirc & " Level

")
ListFolderContents(Server.MapPath(dirc))
response.write ("
color=""red"" size=""2"">
****Newest prints are at the top




")
session ("id") = "test"
response.write ("test" &
vbCrLf)
%>







<% sub ListFolderContents(path)

dim fs, folder, file, item, url , path1 , dd ,dd1

set fs = CreateObject("Scripting.FileSystemObject")
set folder = fs.GetFolder(path)
fileCount = folder.files.count
dim fNames()
dim dmod(9999)
redim fNames(fileCount)
cFcount = 0

for each file in folder.files
cFcount = cFcount + 1
dmod (cFcount) = cstr (file.DateLastModified)
fNames(cFcount) = lcase(file.name)
next

for tName = 1 to fileCount
for nName = (tName + 1) to fileCount
dd = cdate (dmod (nName))
dd1 = cdate (dmod (tname))
if dd > dd1 then
' if strComp(dmod (nName),dmod (tName),0)=1 then
buffer1 = fNames(tName)
fNames(tName) = fNames(nName)
fNames(nName) = buffer1
buffer = dmod (tName)
dmod (tName) = dmod (nName)
dmod (nName) = buffer
end if
next
next

dim cont
path1 = "/public/web page/PROD_DRILL/"
for i = 1 to fileCount
chk = right (Fnames(i),4)
if chk = ".dwf" or chk = ".pdf" then
Response.Write("
  • " &
    fnames(i) & "
    - " _

    & "last updated on " & dmod (i) & "." _
    & "
  • " & vbCrLf)
    end if

    next
    ' Response.Write content

    Response.Write("" & vbCrLf)
    Response.Write("" & vbCrLf)
    end sub

    function MapURL(path)

    dim rootPath, url

    'Convert a physical file path to a URL for hypertext links.

    rootPath = Server.MapPath("/")
    url = Right(path, Len(path) - Len(rootPath))
    MapURL = Replace(url, "\", "/")

    end function %>








    Current Production Drilling Prints





    Production Drilling Prints








    id = "viewer"
    classid = "clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF"
    codebase="http://nmebmdgcweb/viewer.cab#version=4,0,0,160" width= 640
    height= 640 >





    width=10
    height=10
    src="checkimage.dwf">




    If you don't see an drawing above select here
    to install the Express Viewer







    <%@ LANGUAGE="VBScript" %>
















    USE PRINT BUTTON DIRECTLY ABOVE DRAWING TO PRINT






    425 Level


    575 Level


    725 Level


    850 Level


    1000 Level


    1125 Level











    <%
    response.Write (request.QueryString("ID"))

    %>













    <%
    Dim ID
    ID= request.querystring ("ID")

    %>


    Production Drilling






    &lt;BR&gt; &lt;body&gt;&lt;BR&gt; &lt;p&gt;This page uses frames, but your browser doesn't support them.&lt;/p&gt;&lt;BR&gt; &lt;/body&gt;&lt;BR&gt;






    Message 8 of 8
    Anonymous
    in reply to: Anonymous

    John

    Perfect, I was working on a similar method

    In left view the line


    value="">


    in the right view the onclick event written into the field

    Yours look cleaner!

    Thanks for all your help!


    --
    Shawn Romkey P.Geo
    Noranda Mining



    "J...






















































































































































































































    test" &
    > vbCrLf)
    > %>
    >
    >


    >
    >
    >
    >
    >
    > <% sub ListFolderContents(path)
    >
    > dim fs, folder, file, item, url , path1 , dd ,dd1
    >
    > set fs = CreateObject("Scripting.FileSystemObject")
    > set folder = fs.GetFolder(path)
    > fileCount = folder.files.count
    > dim fNames()
    > dim dmod(9999)
    > redim fNames(fileCount)
    > cFcount = 0
    >
    > for each file in folder.files
    > cFcount = cFcount + 1
    > dmod (cFcount) = cstr (file.DateLastModified)
    > fNames(cFcount) = lcase(file.name)
    > next
    >
    > for tName = 1 to fileCount
    > for nName = (tName + 1) to fileCount
    > dd = cdate (dmod (nName))
    > dd1 = cdate (dmod (tname))
    > if dd > dd1 then
    > ' if strComp(dmod (nName),dmod (tName),0)=1 then
    > buffer1 = fNames(tName)
    > fNames(tName) = fNames(nName)
    > fNames(nName) = buffer1
    > buffer = dmod (tName)
    > dmod (tName) = dmod (nName)
    > dmod (nName) = buffer
    > end if
    > next
    > next
    >
    > dim cont
    > path1 = "/public/web page/PROD_DRILL/"
    > for i = 1 to fileCount
    > chk = right (Fnames(i),4)
    > if chk = ".dwf" or chk = ".pdf" then
    > Response.Write("
  • "
    &
    > fnames(i) & "
    - " _
    >
    > & "last updated on " & dmod (i) & "." _
    > & "
  • " & vbCrLf)
    > end if
    >
    > next
    > ' Response.Write content
    >
    > Response.Write("" & vbCrLf)
    > Response.Write("" & vbCrLf)
    > end sub
    >
    > function MapURL(path)
    >
    > dim rootPath, url
    >
    > 'Convert a physical file path to a URL for hypertext links.
    >
    > rootPath = Server.MapPath("/")
    > url = Right(path, Len(path) - Len(rootPath))
    > MapURL = Replace(url, "\", "/")
    >
    > end function %>
    >
    >
    >
    >
    >
    >
    >
    >
    > Current Production Drilling Prints
    >
    >
    >
    >
    >

    > Production Drilling Prints
    >

    >



    >

    >
    >
    > id = "viewer"
    > classid = "clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF"
    > codebase="http://nmebmdgcweb/viewer.cab#version=4,0,0,160" width= 640
    > height= 640 >
    >
    >
    >
    >
    >
    > width=10
    > height=10
    > src="checkimage.dwf">
    >
    >
    >

    >
    If you don't see an drawing above select
    href="../viewer.cab">here
    >
    to install the Express Viewer
    >
    >
    >
    >
    >
    >
    >
    > <%@ LANGUAGE="VBScript" %>
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > USE PRINT BUTTON DIRECTLY ABOVE DRAWING TO PRINT
    >
    >
    >

    >

    > 425 Level


    > 575 Level


    > 725 Level


    > 850 Level


    > 1000 Level


    > 1125 Level


    >
    >

    >
    >

    >

    >
    >

    > <%
    > response.Write (request.QueryString("ID"))
    >
    > %>
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > <%
    > Dim ID
    > ID= request.querystring ("ID")
    >
    > %>
    >
    >
    > Production Drilling
    >
    >
    >
    >
    >
    >
    > &lt;BR&gt; &gt; &lt;body&gt;&lt;BR&gt; &gt; &lt;p&gt;This page uses frames, but your browser doesn't support them.&lt;/p&gt;&lt;BR&gt; &gt; &lt;/body&gt;&lt;BR&gt; &gt;
    >
    >
    >
    >
    >
    >
    >
    >
    >


    ----------------------------------------------------------------------------
    ----


    <%@ LANGUAGE="VBScript" %>



    Current Production Drilling Prints








    Current Production Drilling Prints







    <%
    dirc = request ("dirc")
    response.write ("
    color=""#3300cc"" size=""5"">
    Mine Engineering Production
    Drilling Prints

    " & dirc & " Level

    ")
    ListFolderContents(Server.MapPath(dirc))
    response.write ("
    color=""red"" size=""2"">
    ****Newest prints are at the top




    ")
    session ("id") = "test"
    response.write ("test" &
    vbCrLf)
    response.Flush
    %>







    <% sub ListFolderContents(path)
    response.Write "path: " & path & "

    "
    Response.Flush
    'response.End
    'exit sub

    dim fs, folder, file, item, url , path1 , dd ,dd1

    set fs = CreateObject("Scripting.FileSystemObject")
    set folder = fs.GetFolder(path)
    fileCount = folder.files.count
    dim fNames()
    dim dmod(9999)
    redim fNames(fileCount)
    cFcount = 0

    for each file in folder.files
    cFcount = cFcount + 1
    dmod (cFcount) = cstr (file.DateLastModified)
    fNames(cFcount) = lcase(file.name)
    next

    for tName = 1 to fileCount
    for nName = (tName + 1) to fileCount
    dd = cdate (dmod (nName))
    dd1 = cdate (dmod (tname))
    if dd > dd1 then
    ' if strComp(dmod (nName),dmod (tName),0)=1 then
    buffer1 = fNames(tName)
    fNames(tName) = fNames(nName)
    fNames(nName) = buffer1
    buffer = dmod (tName)
    dmod (tName) = dmod (nName)
    dmod (nName) = buffer
    end if
    next
    next

    dim cont
    path1 = "/public/web page/PROD_DRILL/"
    for i = 1 to fileCount
    chk = right (Fnames(i),4)
    if chk = ".dwf" or chk = ".pdf" then
    'Response.Write("

  • " &
    fnames(i) & "
    - " _
    Response.Write("
  • fnames(i) & "')"">" & fnames(i) & " - " _
    & "last updated on " & dmod (i) & "." _
    & "
  • " & vbCrLf)
    end if

    next
    ' Response.Write content

    Response.Write("" & vbCrLf)
    Response.Write("" & vbCrLf)
    end sub

    function MapURL(path)

    dim rootPath, url

    'Convert a physical file path to a URL for hypertext links.

    rootPath = Server.MapPath("/")
    url = Right(path, Len(path) - Len(rootPath))
    MapURL = Replace(url, "\", "/")

    end function %>





    ----------------------------------------------------------------------------
    ----





    <%@ LANGUAGE="VBScript" %>











    USE PRINT BUTTON DIRECTLY ABOVE DRAWING TO PRINT






    425 Level


    575 Level


    725 Level


    850 Level


    1000 Level


    1125 Level













    Selected File Name:



    <%
    response.Write (request.QueryString("ID"))

    %>



    Can't find what you're looking for? Ask the community or share your knowledge.

    Post to forums  

    Autodesk Design & Make Report