All Activity
- Past hour
-
Add several lisp files to the startup at once
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Lisp, Lisp, Lisp.... and only Lisp -
Add several lisp files to the startup at once
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Last attempt (defun c:LoadFolder (/ sh hwd carp slf pth lstAA a arch nmarch nmarchLL cno cns sl r l admin? ttpp acadAdmin? sustCad) (defun ttpp (cp / c w) (and (vl-file-directory-p cp) (setq w (vlax-get-or-create-object "WScript.Shell")) (findfile (setq c (strcat (getenv "windir") "\\System32\\icacls.exe "))) (vlax-invoke-method w 'run (strcat c "\"" cp "\"" " /q /c /t /grant " (cond ((getenv "userdomain")) ((getenv "computername"))) "\\" (getenv "username") ":(OI)(CI)F /T") 0 :vlax-true ) ) (and w (vlax-release-object w)) ) (defun acadAdmin? (/ arch ruta ruta1 f sh) (if (findfile (setq ruta1 (strcat (getenv "TEMP") "\\acAdmin.si")) ) (vl-file-delete ruta1) ) (if (setq arch (open (setq ruta (strcat (getenv "TEMP") "\\ea.bat")) "w") ) (progn (write-line "@echo off net session >nul 2>&1 if %errorlevel% == 0 ( echo SI> \"%temp%\\acAdmin.si\" )" arch ) (close arch) (setq sh (vlax-create-object "WScript.Shell")) (vlax-invoke sh 'Run ruta 0 :vlax-true) (vlax-release-object sh) (vl-file-delete ruta) (if (findfile ruta1) (progn (vl-file-delete ruta1) T ) ) ) ) ) (defun sustCad (tx a n / c i r) (while (/= (setq c (substr tx (setq i (if i (1+ i) 1)) 1)) "") (setq r (strcat (if r r "") (if (= c a) n c))) ) ) (setq sl (getvar "SECURELOAD")) (SETVAR "SECURELOAD" 0) (if (setq admin? (acadAdmin?) 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)))) (write-line (strcat "(load \"" (sustCad cno "\\" "\\\\") "\")") arch) ) ) ) (if (not Admin?) (vl-catch-all-apply (alert "Acad.exe not have Administrator privileges.\nThis requeriment is necessary to run this command.\n\nExiting...") (exit) ) ) ) (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 "acadDoc.lsp")) a (strcat (vl-filename-directory (findfile "acad.exe")) "\\Support\\acadDoc.lsp")) nmarchLL (strcase (sustCad nmarchLL "\\" "\\\\")) ) (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)) (progn (while (and (not r) (setq l (read-line arch))) (setq r (wcmatch (strcase l) (strcat "(LOAD \"" nmarchLL "\")") ))) (close arch)) (alert (princ (strcat "It was not possible to write to \"acadDoc.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) (alert "\"acadDoc.lsp\" has been successfully modified"))) ) (a (vlax-invoke-method (vlax-create-object "wscript.shell") 'popup "\"acadDoc.lsp\" is correct.\nNo modifications were necessary" 0 "Checking \"acadDoc.lsp\"..." 0) ) ;;; (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) (alert "\"acadDoc.lsp\" has been successfully modified")) (if (= (vlax-invoke-method (vlax-create-object "wscript.shell") 'popup "It appears that it is not possible to write to the \"Support\" directory.\nWould you like me to try to unlock access permisions?" 0 "Access AutoCAD directory" 4 ) 6 ) (progn (ttpp (vl-filename-directory nmarch)) (if (setq arch (open nmarch "w")) (progn (write-line (strcat "(load \"" nmarchLL "\")") arch) (close arch) (alert "DONE!!!\n\n\"acadDoc.lsp\" has been successfully modified")) (vlax-invoke-method (vlax-create-object "wscript.shell") 'popup "The attempt didn't work.\nYou'll need to troubleshoot the problem manually:\n\nDo the following:\nStart StartSuite, find \"ListaLisps.lsp\" file in \"Documents\" folder and select it to load every time you start it.\n\nThis will resolve the issue" 0 "Access AutoCAD directory" 0 ) ) ) ) ) ) (T (alert "Ocurrió lo inesperado")) ) (if arch (startapp "notepad" nmarch)) ) ) (SETVAR "SECURELOAD" sl) (princ) ) -
Add several lisp files to the startup at once
Steven P replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Looking at Omega-Thunder, he used the Registry editor, and not LISP via AutoCAD, you'd need to ask perhaps in a Windows forum how to amend the registry from a text file. The registry is a powerful tool - get it wrong and you might be needing to reinstall your software - so be careful. Via LISP the methods you can use are detailed above, remembering of course that LISP via AutoCAD is mostly for manipulating lines on the screen, not for controlling windows, or the workings of your CAD package. Might be you have to consider the end result and work out if you can do what you ultimately want another way using the above. (Note: Adding to Lee Mac, experience in the area, the commentators on this thread... and those who haven't commented but I know read most threads add up to 10s of thousands of posts, many many years of LISPs, and if they are suggesting other solutions then perhaps... perhaps... that is the way to go) -
Add several lisp files to the startup at once
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
There is no ignoring, I just didn't know that "The Startup Suite cannot be automated via LISP". (Lee Mac Posted November 4, 2014) I just found out about it today. Hasn't anything changed in Autocad since 2014? -
Add several lisp files to the startup at once
Lee Mac replied to Nikon's topic in AutoLISP, Visual LISP & DCL
...or just ignore us -
Add several lisp files to the startup at once
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
-
dear its not big problem i know but every time edit name layout we must go to Titel frame and copy modified or edit and sometime forget edit so i need its field thank for all experts in these site
- Today
-
ABOVE IS NAME FOR LAYOUT IN FRAME DRAWINGS TITEL I WANT TO MAKE THESE FIELD WHEN CHANE THE LAYOUT NAME AUTOMATIC CHAHNGE IN FRAME
-
Add several lisp files to the startup at once
Lee Mac replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Even more reason to give weight to the opinions of those who have more experience in this area To the man with a hammer, everything looks like a nail. -
Add several lisp files to the startup at once
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Since I'm not good at lisp, I can't judge the complexity of the Startup Suite. If there is no alternative, I will explore creating acaddoc.lsp, thank you. -
darn halo started following Hijack command - extract and alter output from vanilla commands
-
Hijack command - extract and alter output from vanilla commands
darn halo posted a topic in AutoLISP, Visual LISP & DCL
Hi, this is a semi-universal question. Is there any way to make my lisproutin run a regullas AC-command and extract info from it. Likewise can i insert my own info in the output? Example, i want my command to look like the output of massprop. But I also want it to write the unit afterwards so instead of it saying: "Volume: 3346204269.0" (Im based i mm) it says "Volume: 3.346204269 m³" Basically im looking for a shortcut to not have to recreate the entire command byt just read info from it and modify the output. I could see this come in hand for a lot of customization. -
Can you post a .dwg with before and after?
-
My AutoCAD 2026 has VLIDE, I still use it occasionally, the default is VSCODE. You may need this... AutoCAD AutoLISP Extension - Visual Studio Marketplace
-
Add several lisp files to the startup at once
Lee Mac replied to Nikon's topic in AutoLISP, Visual LISP & DCL
@Nikon What are your reasons for not loading programs using the acaddoc.lsp (which can be easily manipulated programmatically), versus using the Startup Suite (which is difficult to manipulate programmatically)? -
Add several lisp files to the startup at once
SLW210 replied to Nikon's topic in AutoLISP, Visual LISP & DCL
AFAIK you need other than LISP to do exactly what you want. I doubt if anyone would do a lot of work for a one off program, as most use the already mentioned methods. Here are the recommended methods for doing this, most already mentioned. AutoCAD 2026 Help | About Auto-Loading and Running AutoLISP Routines | Autodesk You could use the Windows registry, maybe. Load lisp in Startup suite via lisp - AutoLISP, Visual LISP & DCL - AutoCAD Forums Lee Mac has a ACADDOC creator. ACADDOC.lsp Creator | Lee Mac Programming And an Autoloader LISP. Autoloader | Lee Mac Programming I agree with this. -
Add several lisp files to the startup at once
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
I don't know of any way to load anything from a text file (or any other) other than calling some Lisp code from acad.lsp, acadDoc.lsp, acad####.lsp, acad####Doc.lsp, or from 'Start Suite'. An alternative to all this is a script. But it's not much different. -
Efficient way to isolate duplicates on a large list
jbreard replied to jbreard's topic in AutoLISP, Visual LISP & DCL
Hi, My goal is to isolate the duplicated elements for edition and further scrutiny. I keep the programm you propose though. I will try to see how it behave on my list as soon as I have the time. Thanks and best regards, Jacques -
Add several lisp files to the startup at once
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
I thank everyone once again and ask once again if it is possible not to use acad.lsp, MNL, CUI. You can simply add several lisp files from notepad to the startup or insert a list of files into the code so as not to specify the path. -
Yudhistira Indar joined the community
-
Marwa Osman Hassan joined the community
- Yesterday
-
Add several lisp files to the startup at once
ronjonp replied to Nikon's topic in AutoLISP, Visual LISP & DCL
I'm still not understanding why this won't do the trick. I've been successfully loading files for 20+ years using a version of that code and a custom MNL tied to a partial CUI. Adding a bunch of lisp routines to the startup suite is not standard practice ( well at least in my little world : ) ) -
Add several lisp files to the startup at once
BIGAL replied to Nikon's topic in AutoLISP, Visual LISP & DCL
I am still sticking with a menu option you can use Lisp to write menu code, it wont be 100% accurate but saves an enormous amount of typing and reduces creation time. -
Add several lisp files to the startup at once
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Something important: AutoCAD may have been running without administrator privileges. Make sure of this. -
Efficient way to isolate duplicates on a large list
GLAVCVS replied to jbreard's topic in AutoLISP, Visual LISP & DCL
I’m leaving here another option that directly deletes all duplicates. I’ve tested it with lists of 40,000 elements, but many of the sublists were repeated. I’m curious to see how it behaves with a list like the one you’re working with. (defun xxx (lst / elm as p n) (while (setq elm (nth (if n n 0) lst)) (while (setq as (assoc (car elm) (cdr (member elm lst)))) (setq lst (vl-remove (setq p as) lst)) ) (if p (setq lst (vl-remove elm lst) p nil) (setq n (if n (1+ n) 1)) ) ) lst ) -
Add several lisp files to the startup at once
Nikon replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Yes, the ListaLisps.lsp file has been created. -
Add several lisp files to the startup at once
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
The solution may simply be to release write permissions for the 'Support' directory. If you search in Documents, you'll find the file 'ListaLisps.lsp'. It encodes the loading of all the files in the folder you selected when running the command. Therefore, you only need to load 'ListaLisps.lsp' to load all the other files.