Open last drawings on startup

In previous versions I had it set to open last drawing on startup as default.
Whilst I can manually follow the progress of this through the startup procedure I'd prefer to have it automatically do that.
I can't see how to do that and not sure what to ask so ask for help here please.

16.1.02 (x64) revision 40514

Comments

  •  The 'Load Last Session' option of the WORKSETS command might be a solution if you create an on_start.lsp lisp which launches WORKSETS at startup.
  •  thanks Louis
    I have no useful understanding of Lisp, and the bit after the "if"  in your reply is where I stumble.
    I'm very 'iffy'  with stuff like that. 
     

  • Dear Richard
    If (sorry for that) on_start.lsp exists in the BricsCAD program folder it will be executed automatically each time BricsCAD is launched.

  •  thanks again Louis. 
    Don't worry about the if. I knew what you were saying. That's the nature of forums that are like 2D. They can be very flat with little concept of expression and real meaning. 
    I'll pick this over and see what I can concoct. 
    I doubt I'll wreck the whole show, BricsCad should survive my meddling. 
  • Richard,

    I assume you must of set something similar up to what Louis said in the previous version? As far as I can see Workset functionality hasn't changed with V16.

    To load the last BricsCAD Session using On_Start.lsp you would do something like the following:
    [code]; On_Start.lsp
    ; Loads automatically when BricsCAD is started
    ;------------------------------------------------------------------------------

    ; Loads all open drawings from the previous BricsCAD session
    (command "._WORKSETS" "_LOAD" "lastsession")

    (prin1); Make a quiet exit[/code]

    On_Start.lsp needs to be on your support file search path (SRCHPATH) . If your creating your own On_Start.lsp, or any other customisation, then I recommend that you place it in your own folder. e.g. C:\MyCad. There are two advantages to this, you know where it is, and it's in a location independent of BricsCAD version.

    An alternative to On_start.lsp would be to run a script at startup. BricsCAD has a number of command line switches start up options. The script would look something like this.
    [code]; Lastworkset.scr
    ; Loads all open drawings from the previous BricsCAD session
    ;------------------------------------------------------------------------------
    ;
    ._WORKSETS
    _LOAD
    lastsession
    [/code]

    To use you would right click on the desktop shortcut for BricsCAD and go to properties. You would then modify the target portion to look something like
    "C:\Program Files\Bricsys\BricsCAD V16 en_US\bricscad.exe" /b "C:\MyCAD\lastworkset.scr"
    Where /b tells BricsCAD to run a script, and C:\MyCAD\lastworkset.scr is the script you want to run.

    Regards, Jason Bourhill CAD Concepts 



    On_Start.lsp

    imageStartup Script.png

    Lastworkset.scr

  • I wasn't going to bring it up in this thread, but since Richard almost did?

    I'm trying to get the Most Recently Used list of drawings to be displayed via lisp.

    I've only started to attempt to tackle this. Any help would be appreciated.

    Thanks
  • I wasn't going to bring it up in this thread, but since Richard almost did?

    I'm trying to get the Most Recently Used list of drawings to be displayed via lisp.

    I've only started to attempt to tackle this. Any help would be appreciated.

    Thanks


    Recent drawings are stored in the registry. You might try something like this to retrieve.
    [code](defun recentfiles ( / Recentpath num FilesList)
        (setq Recentpath "HKEY_CURRENT_USER\\SOFTWARE\\Bricsys\\Bricscad\\V16x64\\en_US\\Recent Paths")
        (setq num 10)
        (repeat 10
            (setq FilesList (cons (vl-registry-read Recentpath (strcat "File" (itoa num))) FilesList))
            (setq num (1- num))
        )
        FilesList
    )[/code]

    Regards, Jason Bourhill CAD Concepts 
  •  thanks Jason 
    Been out in field. 
    I assumed that was the way it came in prior versions as haven't upgraded for a while. 

    I'll have a look at this over weekend. 
    Your input much appreciated thanks. 
    Richard 
  • Jason I created an On_Start.lsp as per yours and placed its location in the support path.

    That does work, but it still loads a default dwg and also it says the "xxx.dwg is currently open, do you want to revert to previous..."
    If 2 dwg's were open then it asks twice.
    This doesn't happen if I unload it from support path. Returns when loaded.

    The "Warning: Unsupported AutoCAD Version 20.0 BRICSCAD" appears whatever I do, with or without the lsp.
    Actually that has been with me from installation.
    I asked about that in another post, but mention here to clarify its not allied to that lsp.

    This is all mystery stuff to me.
  • Jason I created an On_Start.lsp as per yours and placed its location in the support path.

    That does work, but it still loads a default dwg and also it says the "xxx.dwg is currently open, do you want to revert to previous..."
    If 2 dwg's were open then it asks twice.
    This doesn't happen if I unload it from support path. Returns when loaded. 


    The warning is coming up because the drawing is already loaded. This can occur if you start BricsCAD by double clicking on a drawing file in windows explorer. This won't occur with the alternative desktop shortcut method I gave.

    Regards, Jason Bourhill CAD Concepts 
This discussion has been closed.