Results 1 to 10 of 10

Thread: Script Pro Problem

  1. #1
    Active Member
    Join Date
    2007-03
    Location
    Huntingdon, TN
    Posts
    97
    Login to Give a bone
    0

    Default Script Pro Problem

    Recently I tried to write a script to turn off one layer and turn on one layer in about 50 different drawings. The script I used is written below.

    -la off scale half
    -la on scale full
    -la thaw scale full
    qsave
    qsave


    I have tried running different versions of the script with no luck. The program does not recognize the -la command. I can type it on the command line and it works but it does not work in a script. I have also tired replacing -la with -layer. That will also work on the command line but not in a script.

    All I want to do is turn one layer off and another on. If there is a different way of doing it I would be interested. If I have written the script wrong could you please tell me how to correct it?

    Thanks for your time,

  2. #2
    AUGI Director scott.wilcox's Avatar
    Join Date
    2015-11
    Location
    Edmonton, Alberta
    Posts
    990
    Login to Give a bone
    0

    Default Re: Script Pro Problem

    try something like:


    (command "-layer" "off" "scale half" "on" "scale full" "thaw" "scale full" ^C)

    If you want to save it try adding this at the end of your script:

    QSave
    quit
    y
    Last edited by scott.wilcox; 2008-11-17 at 04:15 PM. Reason: added save bit

  3. #3
    Active Member
    Join Date
    2007-03
    Location
    Huntingdon, TN
    Posts
    97
    Login to Give a bone
    0

    Default Re: Script Pro Problem

    First off on a side note I converted the script you wrote out into a lisp routine. Thank you for that it will come in handy later on I am sure

    Back to the topic...

    No matter what I do Scriptpro gets hung up on the command -layer/-la. It does not seem to matter how the script is written.

    So far I have tried 3 different scripts
    1 - outlined in the first post
    2 - (command "-layer" "off" "scale half" "on" "scale full" "thaw" "scale full" ^C)
    qsave
    qsave
    3- scalefull
    qsave
    qsave
    "scalefull" is the command for the attached lisp. That is the lisp I mentioned at the beginning of this post. I have tried the lisp in autcad and it works like a champ.

    I am not sure what to do at this point

    Thanks again,
    Attached Files Attached Files
    Last edited by Anthony Rhodes; 2008-11-17 at 05:30 PM. Reason: added information

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,419
    Login to Give a bone
    0

    Default Re: Script Pro Problem

    There is a space in the layer name. With command line scripts, a space is interpreted as [Enter]. Try enclosing the name in double quotes. What is most likely happening is that the command runs but can't find a layer called "scale" and "half" or "full" get interpreted as the next command, for which there should be a prompt to the effect: "Command FULL not found."

    Also, you don't need to save the code that was given to a lisp file. You can include lisp in your script since lisp can also be run at the command line.
    C:> ED WORKING....


    LinkedIn

  5. #5
    Active Member
    Join Date
    2007-03
    Location
    Huntingdon, TN
    Posts
    97
    Login to Give a bone
    0

    Default Re: Script Pro Problem

    Here is a screen shot of what scriptpro is telling me and a copy of the log. Maybe that will help with figuring out what is going on.

    Ed I will try the double quote idea and get back to you. Thanks

    Thank you,
    Attached Images Attached Images
    Attached Files Attached Files

  6. #6
    Active Member
    Join Date
    2007-03
    Location
    Huntingdon, TN
    Posts
    97
    Login to Give a bone
    0

    Default Re: Script Pro Problem

    Well it took awhile but I finally got the script to work. It ended up being written out like this:

    Code:
    -layer freeze "scale half" off "scale half" on "scale full" thaw "scale full"
     
    qsave
    Thanks again for the help,
    Last edited by Ed Jobe; 2008-11-18 at 04:28 PM. Reason: Added Code tags.

  7. #7
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,419
    Login to Give a bone
    0

    Default Re: Script Pro Problem

    You're welcome. Also, don't forget to use code tags. Access them in the advanced editor. The icon looks like a # sign.
    C:> ED WORKING....


    LinkedIn

  8. #8
    Active Member
    Join Date
    2007-03
    Location
    Huntingdon, TN
    Posts
    97
    Login to Give a bone
    0

    Default Re: Script Pro Problem

    Ed,
    What is this advanced editor you speak of? When I edit a script using the "edit" button it brings up note pad. Here is a screen shot to be sure we are both on the same page.
    Attached Images Attached Images

  9. #9
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: Script Pro Problem

    Quote Originally Posted by Ed Jobe View Post
    You're welcome. Also, don't forget to use code tags. Access them in the advanced editor. The icon looks like a # sign.
    Quote Originally Posted by Anthony Rhodes View Post
    Ed,
    What is this advanced editor you speak of? When I edit a script using the "edit" button it brings up note pad. Here is a screen shot to be sure we are both on the same page.
    I believe Ed was referring to your AUGI thread/post editor, for when you want to post code like script or lisp. One of the buttons has a # sign which assigns [code tags] to separate the code from the text.

    Code:
    IT PUTS YOUR CODE IN SEPARATE BOX LIKE THIS

  10. #10
    Active Member
    Join Date
    2007-03
    Location
    Huntingdon, TN
    Posts
    97
    Login to Give a bone
    0

    Default Re: Script Pro Problem

    Code:
     
    Now I understand
    Thanks again for all of the help with the forum and everything above.

Similar Threads

  1. Problem With Script
    By CADdancer in forum AutoLISP
    Replies: 5
    Last Post: 2013-08-07, 09:54 PM
  2. Script Problem
    By ssaurwei in forum CAD Management - General
    Replies: 2
    Last Post: 2011-11-19, 06:33 PM
  3. Script pro
    By plarson.118418 in forum AMEP General
    Replies: 5
    Last Post: 2008-12-18, 07:30 PM
  4. Applying Script To Multiple layouts problem?
    By pierredib in forum AutoCAD General
    Replies: 1
    Last Post: 2008-08-13, 01:08 PM
  5. Multiple script problem
    By DAVIDALLIN in forum AutoCAD General
    Replies: 2
    Last Post: 2004-12-01, 05:48 AM

Posting Permissions

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