Results 1 to 3 of 3

Thread: Changing the Default Directory in a LSP

  1. #1
    Member
    Join Date
    2014-03
    Posts
    2
    Login to Give a bone
    0

    Default Changing the Default Directory in a LSP

    Ok let me start by saying i am very very new to writing LSP files. That being said i am trying to write a very simple one that Zooms, Saves, and Closes (it runs a script i have already written).

    My code is as follows:

    Code:
    (defun c:zsc   ()
    (command "script" "ZoomSaveClose.scr")
    (princ)
    )
    I know this works if the script file is in the active directory of the drawing i am working in. What i want it to do is search for a different file back, i.e. C:/User/Somefolder/ZoomSaveClose.scr. for the file. Can anyone help me with this? I have already tried...

    Code:
    (defun c:zsc   ()
    (command "script" "C:/User/Somefolder/ZoomSaveClose.scr")
    (princ)
    )
    but that doesn't work and i can't find a pre-written lsp that would give me some idea of how to do this.
    Last edited by BlackBox; 2014-03-13 at 04:12 PM. Reason: Please use [CODE] Tags

  2. #2
    100 Club
    Join Date
    2000-11
    Location
    Ontario, Canada
    Posts
    116
    Login to Give a bone
    0

    Default Re: Changing the Default Directory in a LSP

    Try either of

    Code:
    (defun c:zsc   ()
    (command "script" "C:\\User\\Somefolder\\ZoomSaveClose.scr")
    (princ)
    )
    or

    Code:
    (defun c:zsc   ()
    (command "script" (findfile "C:/User/Somefolder/ZoomSaveClose.scr"))
    (princ)
    )

  3. #3
    Member
    Join Date
    2014-03
    Posts
    2
    Login to Give a bone
    0

    Default Re: Changing the Default Directory in a LSP

    Thanks so much the first option worked!

Similar Threads

  1. Changing default font
    By max in forum Revit Architecture - General
    Replies: 3
    Last Post: 2009-07-28, 03:40 PM
  2. Changing the Default Layer
    By jphillips.88936 in forum AutoCAD General
    Replies: 7
    Last Post: 2008-01-31, 02:49 PM
  3. Set Default directory when opening drawings
    By pk.107812 in forum AutoCAD Customization
    Replies: 2
    Last Post: 2006-10-06, 04:00 PM
  4. Default Insert Directory
    By michel.asboth83160 in forum AutoCAD Customization
    Replies: 4
    Last Post: 2006-01-12, 04:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •