See the top rated post in this thread. Click here

Results 1 to 6 of 6

Thread: LISP Routines Give Errors in New Drawings

  1. #1
    Member
    Join Date
    2006-04
    Posts
    3
    Login to Give a bone
    0

    Default LISP Routines Give Errors in New Drawings

    I have a couple of LISP routines that will error out when I try to use them in the second or later drawing for an AutoCAD session. These programs have been used for many years, and I have only noticed this since AutoCAD 2022 & 2023. However I did go back and reinstall 2021 and I still have the same issue. This has been a problem since my system was upgraded last year and I started with a fresh install of AutoCAD 2022. Other installations in the office of 2022 & 2023 work as they should.

    When I first open AutoCAD and load an existing drawing or start a new drawing, the list routine runs perfectly. When I open another drawing or start a new drawing; the program errors out. I can still go back into the first drawing and use the LISP routine in that drawing, but it never works in drawings opened later. If I save that first drawing and try to re-open it later it will not work unless it is the first drawing of a new AutoCAD session.

    Any help is greatly appreciated
    Brad

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: LISP Routines Give Errors in New Drawings

    How is the AutoLISP file loaded? What is the actual error returned?
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    Member
    Join Date
    2006-04
    Posts
    3
    Login to Give a bone
    0

    Default Re: LISP Routines Give Errors in New Drawings

    The file is loaded through a tool palette then starts the process.

    This is the run sequence and error

    Command: (if (not C:FUNCTIONS_PICK)(load"FUNCTIONS_PICK"))
    C:FUNCTION-PP
    Command: FUNCTION-PP
    Pick first point: _endp of
    Pick second point: _endp of ; error: no function definition: SEC

    The actual line of code that is erroring when I stop the code line by line is
    (setq SCT (SEC AR))

    Where AR is the angle in radians

    Brad

  4. #4
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,109
    Login to Give a bone
    0

    Default Re: LISP Routines Give Errors in New Drawings

    There is an option to load acad.lsp in every drawing.
    Set system variable ACADLSPASDOC to 1.

    It may be that the load expression is in the acad.lsp.
    AutomateCAD

  5. #5
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    2

    Default Re: LISP Routines Give Errors in New Drawings

    Your dependent SEC sub-function call errors, because it hasn't been loaded; you need to find that .LSP file, and load it prior to loading & invoking C:FUNCTION-PP.

    I'd recommend you keep ACADLSPASDOC == 0 (to load Acad.lsp once per session), and instead use the proper AcadDoc.lsp user code file to [auto-?]load any/all needed code each time a drawing opens.

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  6. #6
    Member
    Join Date
    2006-04
    Posts
    3
    Login to Give a bone
    1

    Default Re: LISP Routines Give Errors in New Drawings

    Peter, the ACADLSPASDOC system variable change has resolved the many issues I was having, with more programs than I realized since they are rarely used.

    BlackBox, it is becoming more apparent that our older programing did not use current/better methods. My goal when doing a fresh install of 2022 was to resolve some issues that kept migrating from past versions. Looks like I missed a bunch of stuff that is not used frequently.

    Thank you both for your help!
    Brad

Similar Threads

  1. 2018 Autocad Lisp routines (new ones) not loading
    By jhein759286 in forum AutoLISP
    Replies: 8
    Last Post: 2017-11-30, 04:25 AM
  2. how do you call other lisp routines with lisp?
    By moises.y969653 in forum AutoLISP
    Replies: 1
    Last Post: 2011-02-06, 01:01 PM
  3. Fatal Errors, run time errors
    By carmen.martinez in forum AutoCAD General
    Replies: 2
    Last Post: 2008-04-17, 02:12 PM
  4. Using LISP routines in 2005 Palettes
    By soverpeck in forum AutoCAD Customization
    Replies: 5
    Last Post: 2005-03-23, 09:39 PM
  5. Altogether - Give Us Vids -Give Us...
    By beegee in forum Revit Architecture - General
    Replies: 14
    Last Post: 2005-03-13, 09:10 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
  •