See the top rated post in this thread. Click here

Results 1 to 10 of 10

Thread: Old LISP kinda doesn't work anymore

  1. #1
    I could stop if I wanted to LanceMcHatton's Avatar
    Join Date
    2002-04
    Location
    Las Vegas, NV, USA
    Posts
    304
    Login to Give a bone
    0

    Default Old LISP kinda doesn't work anymore

    Good day, fellow CAD geeks,

    I've had this old simple LISP that we've run for years without issue. It takes the place of the MLEADER button and simply changes the layer for the new multileader to our default 02-ANNO layer prior to creating the multileader and then changes the layer back to whatever the current layer was before using it after the multileader is created.

    Code:
    (defun c:TMCMLeader ()
      (setvar "cmdecho" 0)
      (setvar "filedia" 0)
      (setq oldlyr (getvar "clayer"))
      (setvar "filedia" 1)
      (setvar "clayer" "02-ANNO")
      (command "MLEADER" pause pause)
      (setvar "clayer" oldlyr)
      (princ)
    )
    However, now it will still change the layer, let me create the multileader, but then put the leader on the CURRENT layer instead of the 02-ANNO layer. I know for a fact that it starts putting the multileader on the 02-ANNO layer because it's yellow but then, when it changes the multileader's layer back to the current layer, it's white just like the current layer.

    This all started to happen on my new computer with AutoCAD 2025 installed.

    I know the LISP is rudimentary so please be kind. There's no error checking etc. but I am very much a novice LISP guy. If you have any tweaks you think I should add, I would be more than happy to upgrade it.

    Anyway, has something changed with 2025 that would force the entity back onto the current layer? Does anyone have any idea what might have changed? The file still has a date stamp of 2020 so nothing changed with the LISP.

    Any help would be greatly appreciated.
    Last edited by BlackBox; 2024-08-23 at 05:33 PM. Reason: Please use [CODE] tags

  2. #2
    Mod / Salary / SM Wanderer's Avatar
    Join Date
    2001-12
    Location
    St. Louis
    Posts
    5,416
    Login to Give a bone
    0

    Default Re: Old LISP kinda doesn't work anymore

    Quote Originally Posted by LanceMcHatton View Post
    Good day, fellow CAD geeks,

    I've had this old simple LISP that we've run for years without issue. It takes the place of the MLEADER button and simply changes the layer for the new multileader to our default 02-ANNO layer prior to creating the multileader and then changes the layer back to whatever the current layer was before using it after the multileader is created.

    (defun c:TMCMLeader ()
    (setvar "cmdecho" 0)
    (setvar "filedia" 0)
    (setq oldlyr (getvar "clayer"))
    (setvar "filedia" 1)
    (setvar "clayer" "02-ANNO")
    (command "MLEADER" pause pause)
    (setvar "clayer" oldlyr)
    (princ)
    )

    However, now it will still change the layer, let me create the multileader, but then put the leader on the CURRENT layer instead of the 02-ANNO layer. I know for a fact that it starts putting the multileader on the 02-ANNO layer because it's yellow but then, when it changes the multileader's layer back to the current layer, it's white just like the current layer.

    This all started to happen on my new computer with AutoCAD 2025 installed.

    I know the LISP is rudimentary so please be kind. There's no error checking etc. but I am very much a novice LISP guy. If you have any tweaks you think I should add, I would be more than happy to upgrade it.

    Anyway, has something changed with 2025 that would force the entity back onto the current layer? Does anyone have any idea what might have changed? The file still has a date stamp of 2020 so nothing changed with the LISP.

    Any help would be greatly appreciated.
    Hi, Lance.
    I have moved your post from the Customization forum to the AutoLisp forum, as it will be better served here.
    Melanie Stone
    @MistresDorkness

    Archibus, FMS/FMInteract and AutoCAD Expert (I use BricsCAD, Revit, Tandem, and Planon, too)
    Technical Editor
    not all those who wander are lost

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

    Default Re: Old LISP kinda doesn't work anymore

    Slight modification:

    Code:
    (defun c:TMCMLeader ()
      (setvar "cmdecho" 0)
      (setvar "filedia" 0)
      (setq oldlyr (getvar "clayer"))
      (setvar "filedia" 1)
      (setvar "clayer" "02-ANNO")
      (command-s "MLEADER" pause pause)
      (setvar "clayer" oldlyr)
      (princ)
    )
    More on command-s here:

    https://help.autodesk.com/view/OARXM...7-7E19A4EE19A1
    "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

  4. #4
    Member
    Join Date
    2015-09
    Location
    Madrid - Spain
    Posts
    14
    Login to Give a bone
    0

    Default Re: Old LISP kinda doesn't work anymore

    Quote Originally Posted by BlackBox View Post
    (command-s "MLEADER" pause pause)
    I don't understand how 'PAUSE' can be used when the help says it cannot be.
    No "Pause" command tokens may be used. Expressions that interact with the drawing area or Command Window may be used, but will all be processed before AutoCAD receives and processes any of them.
    The following is not valid with the command-s function:

    Code:
    (command-s "._line" "0,0" PAUSE "")
    Last edited by BlackBox; 2024-08-26 at 03:38 PM.

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

    Default Re: Old LISP kinda doesn't work anymore

    Quote Originally Posted by garcigj View Post
    I don't understand how 'PAUSE' can be used when the help says it cannot be.

    No "Pause" command tokens may be used. Expressions that interact with the drawing area or Command Window may be used, but will all be processed before AutoCAD receives and processes any of them.
    The following is not valid with the command-s function:

    Code:
    (command-s "._line" "0,0" PAUSE "")
    You expected the documentation to be complete and accurate? Haha
    "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
    2015-09
    Location
    Madrid - Spain
    Posts
    14
    Login to Give a bone
    1

    Default Re: Old LISP kinda doesn't work anymore

    Quote Originally Posted by BlackBox View Post
    You expected the documentation to be complete and accurate? Haha
    "How naive of me."

  7. #7
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,061
    Login to Give a bone
    0

    Default Re: Old LISP kinda doesn't work anymore

    Quote Originally Posted by garcigj View Post
    "How naive of me."
    I'm late to the game, but I do this by using a reactor in my ACADDOC.
    It looks for command calls for LEADER, MLEADER, and QLEADER, has a condition statement to look for current CMLEADERSTYLE, and then changes to the appropriate layer according to the leader style. I have leaders on one layer, hardware tags on a different, and part tags on a 3rd.

    The reactor is also setup to work with viewports, points, arrays, xlines, and wipeouts.

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

    Default Re: Old LISP kinda doesn't work anymore

    Quote Originally Posted by madcadder View Post
    I'm late to the game, but I do this by using a reactor in my ACADDOC.
    It looks for command calls for LEADER, MLEADER, and QLEADER, has a condition statement to look for current CMLEADERSTYLE, and then changes to the appropriate layer according to the leader style. I have leaders on one layer, hardware tags on a different, and part tags on a 3rd.

    The reactor is also setup to work with viewports, points, arrays, xlines, and wipeouts.
    Same here; I've just recently changed employers, and literally revising my own reactors for things like this, when I saw this post. Haha

    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

  9. #9
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,061
    Login to Give a bone
    2

    Default Re: Old LISP kinda doesn't work anymore

    Quote Originally Posted by BlackBox View Post
    Same here; I've just recently changed employers, and literally revising my own reactors for things like this, when I saw this post. Haha

    Cheers
    I believe you helped me set up my first reactor. I just took it a little farther.
    It's a great way to force standards into an office too.

  10. #10
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,061
    Login to Give a bone
    0

    Default Re: Old LISP kinda doesn't work anymore

    Quote Originally Posted by BlackBox View Post
    Same here; I've just recently changed employers, and literally revising my own reactors for things like this, when I saw this post. Haha

    Cheers
    While I have a minute to think about it... Whatchu got?
    Code:
    (DEFUN |endreactorcommand| (calling-reactor endcommandinfo / |commandend|) 
      (SETQ |commandend| (CAR endcommandinfo))
      (IF 
        (OR (= |commandend| "DIVIDE")
            (= |commandend| "LEADER") 
            (= |commandend| "MEASURE")         
            (= |commandend| "MLEADER")
            (= |commandend| "MVIEW")
            (= |commandend| "POINT")
            (= |commandend| "QLEADER")
            (= |commandend| "RAY")
            (= |commandend| "VPORTS")
    	(= |commandend| "WIPEOUT")
            (= |commandend| "XLINE")
        )
        (SETVAR "clayer" |reactor_clayer|)
      )
      (PRINC)
    )

Similar Threads

  1. Mouse Center Roller wheel - doesn't "PAN" anymore
    By marvin.r in forum ACA General
    Replies: 3
    Last Post: 2010-06-14, 06:14 PM
  2. Age old Fillet routine isn't working anymore
    By pauljordan in forum AutoLISP
    Replies: 7
    Last Post: 2009-04-01, 08:43 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
  •