+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 11 to 19 of 19

Thread: lisp loader

  1. #11
    Full Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Nov 2017
    Posts
    94

    Default

    Registered forum members do not see this ad.

    ok i am going to have to sit down and look a little closer at the stuff you sent from lee mac to understand it a little better.

    really i just want to be able to have the best route to load stuff and have it work. so either way is fine with me. that is just want i am working with now. but i will look deeper into this stuff.

    thank you again

  2. #12
    Quantum Mechanic BIGAL's Avatar
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,709

    Default

    Have you thought about going to menu's or toolbars these can be pathed to look for a USB or a drive etc. This way one you dont forgot what you called the shortcut. They are grouped to common themes my case alphabetical. Its only a text file so no smart programming required. Some of these do use a library lisp but agian if not loaded pretty simple to force a load 1st. Look at "(if (not aH:getvals"
    Attached Images
    A man who never made mistakes never made anything

  3. #13
    Super Member asos2000's Avatar
    Computer Details
    asos2000's Computer Details
    Operating System:
    WinXP
    Using
    AutoCAD 2007
    Join Date
    Sep 2007
    Location
    Cairo Egypt
    Posts
    678

    Default

    I like this type of loading lisps
    Code:
    (defun c:AAA	()	(load "C:/HasanCAD/AutoCAD/Support/Lisp/AAA.LSP"		) (c:AAA	) (princ)) ; text
    (defun c:BBB	()	(load "C:/HasanCAD/AutoCAD/Support/Lisp/ABB.LSP"		) (c:BBB	) (princ)) ; text
    (defun c:CCC	()	(load "C:/HasanCAD/AutoCAD/Support/Lisp/CCC.LSP"		) (c:CCC	) (princ)) ; text
    By using this way of loading the lisp will not loaded until the user call the lisp.
    Sorry for my English.

  4. #14
    Full Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Nov 2017
    Posts
    94

    Default

    Quote Originally Posted by BIGAL View Post
    Have you thought about going to menu's or toolbars these can be pathed to look for a USB or a drive etc. This way one you dont forgot what you called the shortcut. They are grouped to common themes my case alphabetical. Its only a text file so no smart programming required. Some of these do use a library lisp but agian if not loaded pretty simple to force a load 1st. Look at "(if (not aH:getvals"

    i do kinda like that idea. now with the "(if(not aH:getvals" which section would i be looking at with this one?

  5. #15
    Full Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Nov 2017
    Posts
    94

    Default

    Quote Originally Posted by asos2000 View Post
    I like this type of loading lisps
    Code:
    (defun c:AAA	()	(load "C:/HasanCAD/AutoCAD/Support/Lisp/AAA.LSP"		) (c:AAA	) (princ)) ; text
    (defun c:BBB	()	(load "C:/HasanCAD/AutoCAD/Support/Lisp/ABB.LSP"		) (c:BBB	) (princ)) ; text
    (defun c:CCC	()	(load "C:/HasanCAD/AutoCAD/Support/Lisp/CCC.LSP"		) (c:CCC	) (princ)) ; text
    By using this way of loading the lisp will not loaded until the user call the lisp.



    i am just wanting to make sure that i am understanding this. (sorry very green) the (load "C:/HasanCAD/AutoCAD/Support/Lisp/AAA.LSP" this would be the file path of said lisp that you are wanting to add to the file?

  6. #16
    Super Member asos2000's Avatar
    Computer Details
    asos2000's Computer Details
    Operating System:
    WinXP
    Using
    AutoCAD 2007
    Join Date
    Sep 2007
    Location
    Cairo Egypt
    Posts
    678

    Default

    subose you have a lisp called GetSlope.LSP and command to invoke the lisp is GTS
    Code:
    (defun c:GTS	()	(load "C:/HasanCAD/AutoCAD/Support/Lisp/GetSlope.LSP"		) (c:GTS	) (princ)) ; Get Slope at specified point
    That means whenever you call the lisp, It will be loaded.
    Sorry for my English.

  7. #17
    Full Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Nov 2017
    Posts
    94

    Default

    Quote Originally Posted by asos2000 View Post
    subose you have a lisp called GetSlope.LSP and command to invoke the lisp is GTS
    Code:
    (defun c:GTS	()	(load "C:/HasanCAD/AutoCAD/Support/Lisp/GetSlope.LSP"		) (c:GTS	) (princ)) ; Get Slope at specified point
    That means whenever you call the lisp, It will be loaded.
    that make perfect sense.

    thank you

  8. #18
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Oct 2015
    Posts
    101

    Default

    I use this:

    Code:
    (defun c:appreload ()
    ;;Load all LISP files in a folder
    ;;LISP folder location:
      (setq mylispfolder "c:\\Desktop\\") ;;change this to suit
    
      (setq myfiles (vl-directory-files mylispfolder "*.lsp" nil)) ;;myfiles is list of files
      (setq mylistlength (length myfiles)) ;;count of number of lsp files
      (setq acount -1) ;;a counter
    
      (repeat mylistlength
        (setq acount (1+ acount))
        (setq FailedtoLoad (strcat (nth acount myfiles) " failed to load"))
        (load (strcat mylispfolder (nth acount myfiles)) FailedtoLoad) ;;Loads file
      )
      (princ)
    )
    This will load all the LISP files in a specified folder. Its probably not the smartest code but it works for me.

    Note: If you are having this run at start up then don't do it from a LISP file contained in the 'mylispfolder' location since it is possible to get an endless loop when it loads / reloads that file and it runs this routine again... and again... You could modify this code to exclude a file to reload if you want.


    I use this mainly when I am trying things out - far quicker to type in appreload than going through AutoCAD to load a modified LISP file

  9. #19
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Oct 2015
    Posts
    101

    Default

    Registered forum members do not see this ad.

    Writing a line for each LISP routine:
    Code:
    (defun c:GTS	()	(load "C:/HasanCAD/AutoCAD/Support/Lisp/GetSlope.LSP"		) (c:GTS	) (princ)) ; Get Slope at specified point
    works nicely, but suppose you have many LISP routines to load? (for example, I have 1 routine to plot A3, one to plot A2 etc, and black and white, and PDF colour and black and white, landscape plot and portrait plot.. about 40 routines just for plotting, then there are all the others...). You can modify my example with this line if you can get a list of all the LISPs within all the files in a folder (Lee Macs GetSyntax can help here). Mine will load everything in a folder so add a new file in there, it will load with no other work. Its just another idea for you to consider

Similar Threads

  1. Judge ET tool, if not installed, not loader and prompt.
    By andy_lee in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 19th May 2014, 12:51 pm
  2. Judge cad version,If version is too low,not loader and prompt.
    By andy_lee in forum AutoLISP, Visual LISP & DCL
    Replies: 9
    Last Post: 19th May 2014, 08:52 am
  3. [LISP] First time writing LISP routine... trying to rotate, move and scale
    By chiimayred in forum AutoLISP, Visual LISP & DCL
    Replies: 6
    Last Post: 18th Jul 2013, 06:02 pm
  4. frontend loader
    By JENKAT in forum AutoCAD General
    Replies: 0
    Last Post: 11th Apr 2013, 09:20 pm
  5. Opengl loader for autocad supported formats
    By 3dvdt in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 6th Oct 2006, 01:34 pm

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