Oracle Programming so a Drawing will Open using the Solidworks Viewer

Discussion in 'SolidWorks' started by waligora, Dec 15, 2004.

  1. waligora

    waligora Guest

    Okay geniuses, we are trying to program through Oracle a way to open a
    drawing using the Solidworks Viewer.

    We are able to fire off the Solidworks Viewer but the drawing does not
    open up. What is note worthy, is that the journal file generated is
    not <swxJRNL.swj>, instead it is WINNTswxJRNL.BAK.

    This journal file tells the tale that the SWViewer did start and that
    is all (ie. no open command was issued).

    Here is the Oracle code so far. This is for users that do not have the
    Solidworks application on thier desktop, but do have the Viewer. This
    code works fine for opening drawings that are DWG format with a
    VoloViewer.

    This first procedure checks if the viewer is open. If not, it then
    opens it...


    PROCEDURE chk_solidworks IS
    convid PLS_INTEGER;
    appid PLS_INTEGER;
    BEGIN
    convid := DDE.Initiate('SWViewer', 'system');
    DDE.Terminate(convid);
    EXCEPTION
    when others then
    appid := DDE.App_Begin('c:\program
    files\solidworksviewer\swviewer.exe',DDE.APP_MODE_MAXIMIZED);
    END;

    This second procedure opens the drawing...

    Declare
    convid PLS_INTEGER;
    path Varchar2(150);
    Begin
    path := :dm_profile.doc_path;
    convid := DDE.Initiate('SWViewer', 'system');
    DDE.Execute(convid,'[open("'||path||'")]',10000);
    DDE.Terminate(convid);
    End;
     
    waligora, Dec 15, 2004
    #1
  2. waligora

    CS Guest

    I can't help you with Oracle but you could create a batch and run that

    if you put something similar to this in a batch it will open a file using
    swviewer you may have to check for the installation directory on the machine
    though

    D:
    cd Program Files\SOLIDWORKSVIEWER
    SWVIEWER.exe "c:\410001.SLDDRW"

    pause


    Corey
     
    CS, Dec 15, 2004
    #2
  3. waligora

    waligora Guest

    Thanks,

    We just became successful.

    seems we had to place the path right into the command string that fired
    off the application.

    Ron
     
    waligora, Dec 15, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.