+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
  1. #1
    Full Member Nobull84's Avatar
    Using
    AutoCAD 2011
    Join Date
    Nov 2013
    Posts
    86

    Default Combining Lisp routines

    Registered forum members do not see this ad.

    Maybe I'm just too new at the LISP thing but I've been through many forums and nothing really seems to spell it out for the layman, i.e. me.

    My company seems rather fresh to LISP as well but they have one "master" list of lisps they have used for some time. This list is loaded in everyone's CAD. I have several others that I have found that I would like to add to this master list but I don't see how they are separated and loaded.

    The idea is to update this master list with new commands and have others be able to simply have them available the next time CAD is started up again when the original lisp is loaded. Is there a quickie routine that loads other locations?

    I was given this style of line and told it would do such a thing but I must still be doing something wrong
    HTML Code:
    (load "brkblk")
    (load "BreakObjects18")
    (load "CCC")
    (load "Copy2DrawingsV1-2")
    (load "Copy2LayoutsV1-1")
    (load "DoubleOffsetV1-1")
    (load "Dynamic-Offset")
    (load "MCOPY")
    (load "QuickDimAligned-QDA")
    (load "ROT2ENT")
     
     
    (princ (load "BreakObjects18" "\nBreakObjects18.LSP file not loaded.."))
    (princ (load "CCC" "\nCCC.LSP file not loaded.."))
    (princ (load "Copy2DrawingsV1-2" "\nCopy2DrawingsV1-2.LSP file not loaded.."))
    (princ (load "Copy2LayoutsV1-1" "\nCopy2LayoutsV1-1.LSP file not loaded.."))
    (princ (load "DoubleOffsetV1-1" "\nDoubleOffsetV1-1.LSP file not loaded.."))
    (princ (load "Dynamic-Offset" "\nDynamic-Offset.LSP file not loaded.."))
    (princ (load "MCOPY" "\nMCOPY.LSP file not loaded..."))
    (princ (load "QuickDimAligned-QDA" "\nQuickDimAligned-QDA.LSP file not loaded..."))
    (princ (load "ROT2ENT" "\nROT2ENT.LSP file not loaded..."))
    Thanks for the patience,

    -Nobull

  2. #2
    Forum Deity David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    2,534

    Default

    I use this scenario; lets say ycopy.lsp contains a definition for c:ycopy
    Code:
    (defun c:yc () (if (not c:ycopy) (load "YCOPY"))(c:ycopy))
    This way you have shortcut keys defined with on demand usage of resources.

    I have approx 400 of these in my acad(doc).lsp file


    You would need to make a single defun for each routine.

    You could always have a large library .lsp file that contains many routines but has to be fully loaded in each session. A waste of resources ( IMO ) not to mention very hard to debug.


    -David
    R12 (Dos) - A2K

  3. #3
    Junior Member
    Computer Details
    andy81's Computer Details
    Operating System:
    XP , Win7
    Discipline
    Structural
    andy81's Discipline Details
    Occupation
    CAD Support
    Discipline
    Structural
    Using
    AutoCAD 2011
    Join Date
    Sep 2013
    Location
    Canada
    Posts
    10

    Default

    Hi Nobull
    I am new to this all as well, but i think you may want to have a look at Acad.Lsp File
    There are great resource about this at:
    http://www.afralisp.net/autolisp/tut...lisp-files.php
    http://lee-mac.com/autoloading.html
    I hope this helps.

    cheers,
    Andy

  4. #4
    Senior Member
    Computer Details
    Snownut's Computer Details
    Operating System:
    Windows 10 Home premium
    Computer:
    Lenovo
    Using
    not applicable
    Join Date
    Nov 2010
    Location
    New Hampshire
    Posts
    238

    Default

    Just be careful as David's example uses a two letter name "YC", not to replace an ACAd command with the name of the lisp.

  5. #5
    Forum Deity David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    2,534

    Default

    Quote Originally Posted by Snownut View Post
    Just be careful as David's example uses a two letter name "YC", not to replace an ACAd command with the name of the lisp.

    Other than acad.pgp, I know of no other core ACAD command that is only 2 letters long. Maybe something new ?
    R12 (Dos) - A2K

  6. #6
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,902

    Default

    My question is are you only accessing via the keyboard ?

    If your using menus or toolbars then you can demand load a single lisp that is not in the master lisp. I took a different approach for a big scheme 100+ lisps I had a common library of functions that autoloaded stuff like setting correct layers dynamically, each lisp was called from a menu but once loaded often could then be called again by keyboard. Its pretty hard to remember the key code for every lisp hence menu's.
    A man who never made mistakes never made anything

  7. #7
    Senior Member
    Computer Details
    Snownut's Computer Details
    Operating System:
    Windows 10 Home premium
    Computer:
    Lenovo
    Using
    not applicable
    Join Date
    Nov 2010
    Location
    New Hampshire
    Posts
    238

    Default

    David,

    What happens when you type "BH" at the command prompt.

  8. #8
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,902

    Default

    The majority of shortcut commands are listed in acad.pgp pretty sure BH boundary hatch is part of express hence not in acad.pgp so both of you are correct.
    A man who never made mistakes never made anything

  9. #9
    Forum Deity David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    2,534

    Default

    Yep, looks like a shortcut somewhere other than acad.pgp
    Attached Images
    R12 (Dos) - A2K

  10. #10
    Senior Member
    Computer Details
    Snownut's Computer Details
    Operating System:
    Windows 10 Home premium
    Computer:
    Lenovo
    Using
    not applicable
    Join Date
    Nov 2010
    Location
    New Hampshire
    Posts
    238

    Default

    Registered forum members do not see this ad.

    There's a bunch more two letter shortcuts like that (sorry I don't have a list), just as a precaution the OP should test for the existance of any particular two letter shortcut prior to naming a LISP function with a two letter name.

    I don't believe the two letter commands are part of express tools as they also works in BricsCAD.

    Bruce

Similar Threads

  1. Replies: 3
    Last Post: 10th Aug 2010, 04:39 am
  2. Combining LiSP's
    By VisDak in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 23rd Jun 2010, 06:51 pm
  3. Advice on combining these two LISP routines
    By tzframpton in forum AutoLISP, Visual LISP & DCL
    Replies: 17
    Last Post: 22nd Apr 2010, 03:16 pm
  4. Lisp routines?
    By Jadgpanther in forum AutoCAD Beginners' Area
    Replies: 2
    Last Post: 25th Sep 2007, 12:30 pm
  5. Combining layer rename lisp
    By royalchill in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 8th Mar 2007, 06:59 pm

Tags for this Thread

Bookmarks

Posting Permissions

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