Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. I have checked the code, the files are uploaded to the drawing, but they are not uploaded to the startup. In the new file, I need to use the code again.
  3. Hi Is the goal of fetching the duplicate lists to remove them from the main list? This is what your code appears to read
  4. Today
  5. @Nikon You should copy the code again. I didn't paste the code correctly. Also, I've also modified something.
  6. Thanks for participating, I'll try this code.
  7. Why not use the acaddoc.lsp instead?
  8. And what does it do? The same as the previous command BUT ALSO: – it writes into 'acad.lsp' Lisp code to load, from the next startup onward, the file 'ListaLisps.lsp', which in turn calls the loading of all the Lisp files in the selected folder. – adds the location of the files to AutoCAD’s 'SupportPath'.
  9. Maybe this will do what you need. (defun c:LoadFolder (/ sh hwd carp slf pth lstAA a arch nmarch nmarchLL cno cns sl r l) (setq sl (getvar "SECURELOAD")) (SETVAR "SECURELOAD" 0) (if (setq sh (vla-getinterfaceobject (vlax-get-acad-object) "shell.application") hwd (vl-catch-all-apply 'vla-get-hwnd (list (vlax-get-acad-object))) carp (vlax-invoke-method sh 'browseforfolder (if (vl-catch-all-error-p hwd) 0 hwd) "Folder to load" 0 "") ) (if (setq slf (vlax-get-property carp 'self) pth (vlax-get-property slf 'path) pth (vl-string-right-trim "\\" (vl-string-translate "/" "\\" pth)) ) (if (setq lstAA (vl-directory-files pth "*.lsp")) (foreach a lstAA (if (not arch) (setq arch (open (setq nmarchLL (strcase (strcat (VL-REGISTRY-READ "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders" "Personal" ) "\\ListaLisps.lsp" ) ) ) "w" ) ) ) (load (strcat (setq cno (strcat pth "\\" a)))) ;;; (princ (strcat "\n" cno "... *** LOADED ***")) (write-line (strcat "(load \"" cno "\")") arch) ) ) ) ) (if arch (progn (close arch) ;;;;;; (startapp "notepad" nmarch) (princ (strcat "\n*** " (itoa (length lstAA)) " files LOADED ***")) (if (not (wcmatch (strcase pth) (setq cns (VLAX-get-property (setq prf (VLAX-get-property (vla-get-preferences (vlax-get-acad-object)) "files")) "SupportPath")))) (progn (vlax-put prf "SupportPath" (strcat cns ";" pth)) (princ (strcat "\n*** New SupportPath: " pth)) ) ) (setq nmarch (if (setq a (findfile "acad.lsp")) a (strcat (vl-filename-directory (findfile "acad.exe")) "\\Support\\acad.lsp"))) (if a (if (setq arch (open nmarch "r")) (progn (while (and (not r) (setq l (read-line arch))) (setq r (wcmatch (strcase l) "(LOAD *LISTALISPS.LSP\")" ))) (close arch)) (alert (princ (strcat "It was not possible to write to \"acad.lsp\". Open the file yourself and write: (load \"" nmarchLL "\")"))) ) ) (cond ((and a (not r)) (if (setq arch (open nmarch "a")) (progn (write-line (strcat "(load \"" nmarchLL "\")") arch) (close arch))) ) (a (princ) ) ;;; (nmarch (if (setq arch (open nmarch "w")) (progn (write-line "(LOAD \"LISTALISPS.LSP\")" arch) (close arch)))) (nmarch (if (setq arch (open nmarch "w")) (progn (write-line (strcat "(load \"" nmarchLL "\")") arch) (close arch)))) (T (alert "Ocurrió lo inesperado")) ) (startapp "notepad" nmarch) ) ) (SETVAR "SECURELOAD" sl) (princ) )
  10. devitg

    any Lisp editor not VLIDE

    @mhupp Thanks
  11. Do a pseudo alias: (defun c:ALisp ( / ) (c:MyLisp) ) (defun c:MyLisp ( / ) ... ) However I tend to stick with vanilla CAD as far as I can so when it comes to upgrade time there are fewer things to remember to do and reset. With LISPs, just need to add about 10 files to the start-up suit and I am off and running again.
  12. mhupp

    any Lisp editor not VLIDE

    @devitg That is my understanding, yes. I know BircsCAD still has it.
  13. devitg

    any Lisp editor not VLIDE

    @mhupp So I could understand that 2020 is the last that has VLIDE .
  14. I use custom user names in acad.pgp, and for this the lisp files must be in the Startup Suite.
  15. mhupp

    any Lisp editor not VLIDE

    Link is for 2021 version.
  16. devitg

    any Lisp editor not VLIDE

    @mhupp ok . I will try to use the VSCode. ANy way what was the las ACAD version that have VLIDE inside , I run in W11
  17. mhupp

    any Lisp editor not VLIDE

    Yes, its their default now. have to set lispsys to 0 before it will work with vscode. https://help.autodesk.com/view/OARX/2021/ENU/?guid=GUID-037BF4D4-755E-4A5C-8136-80E85CCEDF3E
  18. devitg

    any Lisp editor not VLIDE

    @Lee Mac Thanks I will try. Do VSCode allow to work as VLIDE , ?
  19. Thanks ! I will look into that Jacques
  20. Lee Mac

    any Lisp editor not VLIDE

    VSCode?
  21. There are or is a LISP editor outside ACAD own VLIDE , ? I have a student version , it allow to load LSP , but it do not edit it by VLIDE . Thanks in advance
  22. Why do you specifically need to use the Startup Suite to load your programs?
  23. You might find the following marginally faster - (defun foo ( lst / ass rtn ) (foreach itm lst (if (setq ass (assoc (car itm) rtn)) (setq rtn (subst (vl-list* (car ass) itm (cdr ass)) ass rtn)) (setq rtn (cons (list (car itm) itm) rtn)) ) ) (mapcar 'cdr (vl-remove-if-not 'cddr rtn)) )
  24. Thank you all! You've offered me a lot of options... But not what I need. So it's impossible to upload a list (.txt) of 50 lisp files to the startup (bypassing the startup window)?
  25. Thank you all for your answers ! I was able to do what I wanted to achieve thanks to you. The function that worked for me was the first one submitted by LeeMac. I only had to had the line below to get exactly the list I wanted : (defun foo ( lst / ass rtn ) (foreach itm lst (if (setq ass (assoc (car itm) rtn)) (setq rtn (subst (vl-list* (car ass) itm (cdr ass)) ass rtn)) (setq rtn (cons (list (car itm) itm) rtn)) ) ) ) ; lst_test = my list with the structure described in my post i.e lst_test = (lst1 lst2 ... lstn) with lstx = (MAT, ALT, COD, ...) (setq lst_test_sort (foo lst_test)) (setq lst_test_dup (vl-remove nil (mapcar '(lambda(p) (if (> (length p) 2) (cdr p) nil)) lst_test_sort))) I also tried the other function supplied by LeeMac but it was much slower than the first one. I was not able (patient enough) to make it work on a list with approx 25 000 elements. Thanks to BIGAL also for the reply. I must confess that I did not have the time to test the proposed solution. I will have a look at it as soon as I can manage some spare time. I really appreciate the time you took to answer me. Best regards, Jacques
  26. Are all your files in the same folder - my startup suit can select multiple files in the same folder. Takes time if they are in different folders. I did see a way to amend the startup suit files using the registry settings but paused that idea - I think it was too much dependant on versions and your profile to make it any use but me I used to add all my files to the startup suit, but eventually that slows loading a CAD file as it loads everything. Now I load the 3 or 4 LISP files that I use all the time and load on demand the rest. If the files are in a trusted location use AutoLoad from BigAl. Mine arn't (on purpose - saved on the network), otherwise I use something like this: (defun c:MyLisp () (load "C:/Location/MyLISPs.LSP") (c:MyLisp) (princ)) One line for each command you might use - a bit of effort to list all the LISPs if you are doing them all at once, not so bad if you add to the list with each new LISP. This is saved in a LISP file which is added to the startup suit. Call the LISP, if it isn't loaded then it runs the above line, loads the file, runs the LISP. Or you can go with GLAVCVS idea, use your list of LISP files and for each file (load "C:/Location/MyLISPs.LSP") saved into a LISP file added to startup. No need for a Defun just these lines so they autorun and load the files. This should give you a listing of files: Where FPath is the file path (remember double backslash) and searchterm can be used to filter by filename, can use wildcards, * for any character (example blk* for any lisp file beginning with blk) (defun GetBLKFiles2 ( FPath searchterm / BLKFiles) (setq searchterm (strcat searchterm ".lsp")) (setq BLKFiles (vl-directory-files FPath searchterm)) BLKFiles )
  27. Is it possible to use lisp to get a list of lisp files? (in the form of a text file, put the file on the desktop),which are in the startup.
  1. Load more activity
×
×
  • Create New...