Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: GERVAR for drawing path for script SAVEAS?

  1. #1
    100 Club
    Join Date
    2007-05
    Location
    Fort Worth, Texas Cowtown USA
    Posts
    139

    Default GERVAR for drawing path for script SAVEAS?

    I'm looking to output the current drawing location to the command prompt followed by the new name.

    I am running a script on a client's title block to prep it to be in our standard colors, line weights, etc. Everything in the script is running great except when it comes to save my work. We typically leave the client's files intact and do a saveas to our standard name (TB.dwg) so it's easier for everyone in the office to find the title block.

    Anyway my script file is looking like this...

    Code:
    filedia;0;saveas;2004;(getvar,dwgprefix)TB.dwg;filedia;1
    ;
    But the drawing is being saved in "My Documents" and not in the current location.

    Can someone point me in the right direction?

  2. #2
    AUGI Addict .T.'s Avatar
    Join Date
    2000-12
    Location
    Lost
    Posts
    1,473

    Default Re: GERVAR for drawing path for script SAVEAS?

    Quote Originally Posted by ahefner
    I'm looking to output the current drawing location to the command prompt followed by the new name.

    I am running a script on a client's title block to prep it to be in our standard colors, line weights, etc. Everything in the script is running great except when it comes to save my work. We typically leave the client's files intact and do a saveas to our standard name (TB.dwg) so it's easier for everyone in the office to find the title block.

    Anyway my script file is looking like this...

    Code:
    filedia;0;saveas;2004;(getvar,dwgprefix)TB.dwg;filedia;1
    ;
    But the drawing is being saved in "My Documents" and not in the current location.

    Can someone point me in the right direction?
    Maybe try:

    Code:
    filedia;0;saveas;2004;(strcat (getvar "dwgprefix") "TB.dwg");filedia;1;
    You might want to do this as a lisp routine so you can check if TB.dwg already exists in the directory with findfile, though.
    Tim Creary
    S&D
    DILLIGAF

  3. #3
    100 Club
    Join Date
    2007-05
    Location
    Fort Worth, Texas Cowtown USA
    Posts
    139

    Default Re: GERVAR for drawing path for script SAVEAS?

    Well, we name the drawing TB because there isn't a file aready in the directory with that name. This script is designed to be applied after we receive the drawings from the arch and after they've been unzipped.

    Thank for the help, I appreciate it.

  4. #4
    100 Club
    Join Date
    2007-05
    Location
    Fort Worth, Texas Cowtown USA
    Posts
    139

    Default Re: GERVAR for drawing path for script SAVEAS?

    It returns "INVALID FILE NAME".

    Any ideas why?

  5. #5
    AUGI Addict .T.'s Avatar
    Join Date
    2000-12
    Location
    Lost
    Posts
    1,473

    Default Re: GERVAR for drawing path for script SAVEAS?

    Quote Originally Posted by ahefner
    It returns "INVALID FILE NAME".

    Any ideas why?
    Oh, sorry, I didn't see that you were using a script. I thought you were setting up a button.

    Try:

    Code:
    filedia
    0
    saveas
    2004
    (strcat (getvar "dwgprefix") "TB.dwg")
    filedia
    1
    instead.
    Tim Creary
    S&D
    DILLIGAF

  6. #6
    100 Club
    Join Date
    2007-05
    Location
    Fort Worth, Texas Cowtown USA
    Posts
    139

    Default Re: GERVAR for drawing path for script SAVEAS?

    scripts and buttons can use either format.

    The code you just posted will return the exact same message.

  7. #7
    AUGI Addict .T.'s Avatar
    Join Date
    2000-12
    Location
    Lost
    Posts
    1,473

    Default Re: GERVAR for drawing path for script SAVEAS?

    Quote Originally Posted by ahefner
    scripts and buttons can use either format.

    The code you just posted will return the exact same message.
    That's weird. It works fine here...

    Edit, I see 2008. Let me try it there; Ive been using 06.
    Tim Creary
    S&D
    DILLIGAF

  8. #8
    100 Club
    Join Date
    2007-05
    Location
    Fort Worth, Texas Cowtown USA
    Posts
    139

    Default Re: GERVAR for drawing path for script SAVEAS?

    I'm creating the script to run in 2006 (full AutoCAD).

  9. #9
    AUGI Addict .T.'s Avatar
    Join Date
    2000-12
    Location
    Lost
    Posts
    1,473

    Default Re: GERVAR for drawing path for script SAVEAS?

    Quote Originally Posted by ahefner
    I'm creating the script to run in 2006 (full AutoCAD).
    I'm at a loss.

    It works for me like:

    Code:
    filedia
    0
    saveas
    2004
    (strcat (getvar "dwgprefix") "TB.dwg")
    filedia
    1
    or

    Code:
    filedia 0 saveas 2004 (strcat (getvar "dwgprefix") "TB.dwg") filedia 1
    FWIW, I've never used semicolons for "enter" in script files, only in macros; I've always used spaces and new line. The help file says that semicolons are used to comment in script files if used as the first character. I'm not sure about other places, but semicolons don't seem to work for me.

    You might also check to be sure that this thread editor isn't adding extra spaces at the end or something when you copy and paste, also.

    Maybe someone else will have an idea.
    Tim Creary
    S&D
    DILLIGAF

  10. #10
    100 Club
    Join Date
    2007-05
    Location
    Fort Worth, Texas Cowtown USA
    Posts
    139

    Default Re: GERVAR for drawing path for script SAVEAS?

    can you get it to work with a button? That method would work too.

Page 1 of 2 12 LastLast

Similar Threads

  1. Open dwg via script using relative path.
    By ryan_22283391556 in forum AutoCAD General
    Replies: 8
    Last Post: 2011-04-07, 04:08 AM
  2. Script to extract cannoscalevalue from .dwg files, append filename and saveas
    By wadehammond in forum AutoCAD Civil 3D - General
    Replies: 0
    Last Post: 2011-03-17, 04:38 PM
  3. Navisworks - Force script saveas
    By bma in forum NavisWorks - General
    Replies: 0
    Last Post: 2010-04-09, 08:24 AM
  4. Script to export DWG to NWD path issue
    By OCD in forum AutoLISP
    Replies: 5
    Last Post: 2009-04-07, 04:56 AM
  5. saveas with a script
    By clovis in forum AutoCAD Mechanical - General
    Replies: 3
    Last Post: 2007-06-21, 03:25 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
  •