All Activity
- Past hour
-
-
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
I need you to explain a little more. Did you use multiple Lisp commands or just load files? Take a screenshot of the code you pasted into the "acad2021Doc.lsp" file. - Today
-
I tested the code a bit more, sometimes the window with the message "Display commands on the screen?" does not work correctly. I have to click "Yes" several times, I specify the insertion point of the text, but the window appears again, and if I click "No", the window also appears several times. And one more small note, when I specify the insertion point, I don't see how the text is inserted. A window about saving the drawing appears immediately… Maybe I'm doing something wrong...
-
Steven P started following Open named viewports with lisp
-
Maybe this might help: Lee Macs option at the end might give you a start. Do you want it to open the viewports automatically or with the user perhaps pressing say 'space' bar?
-
Hello, good day. I’d like to continue working on the material volume tables in AutoCAD — specifically the ones that have been exploded and no longer retain a defined table structure. These tables begin with a top row that contains the stationing of each section, formatted like this: Material(s) at Station 0+250.00 This first row contains only one column. The second row has four fixed columns that serve as headers for the data rows below. These headers are consistent across all sections and do not change. From left to right, they are: Material Name Area Volume Cumulative Volume The third row and all subsequent rows contain the actual data, aligned with the headers above. The material names may vary from project to project, but within a single project, they remain consistent across all sections. In the second column of each row, the area of the material is listed as a numeric value. The third column contains the volume, and the fourth column contains the cumulative volume. Since these tables have been exploded, the numbers no longer update automatically. That’s why we need a solution where, after manually updating the area values, the corresponding volumes and cumulative volumes are automatically recalculated and replaced in the table. So far, all our attempts to achieve this have failed. Now I’d like to share some insights that might help: Stationing is critical. The first step must be to extract the station number from the top row as an integer. This allows us to calculate the distance between two consecutive sections, which is essential for computing the volume of a truncated cone. Area values should remain unchanged. We only need to read them and use them in calculations to update the Volume and Cumulative Volume columns. New observation about table geometry: The vertical spacing between the second row and all subsequent rows is exactly three times the text height. Also, the insertion point (X coordinate) of the area values is exactly aligned with the insertion point of the word “Area” — and the same applies to the Volume and Cumulative Volume values. Update logic: Let’s assume we have only one material row (though usually there are more). Let’s name the area value in the first section A1, and the area in the second section A2. These two values represent the top and bottom surfaces of a truncated cone with height H, where H is the difference between the station numbers of the two sections. The calculated volume should replace the volume value in the second section. Then, this volume should be added to the cumulative volume from the first section, and the result should replace the cumulative volume in the second section. Naturally, this volume and cumulative update must follow the correct station order
-
Mahdi_Nasr joined the community
-
I need a lisp code to open named viewports one after another. To view as animation.
-
I'm not sure...
-
Lee Mac started following 3dpolyline Triangle with 4 vertices
-
OVERKILL should remove the duplicate vertices.
-
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
This tool will be perfect when complemented by another tool that detects this MTEXT and loads the files it refers to. This means that the command name must be the same as the file name. This idea needs to be further developed. It's very interesting. PS: Is it possible that this issue has already been discussed in another thread on this forum? -
@GLAVCVS ¡Muchísimas gracias! Thanks a lot! The last code works great! I get a list of used programs. Special thanks for "Nikon's doubts". Now it's the end of my doubts. ¡Buena suerte en nuevos proyectos!
-
chnghiem1997 joined the community
- Yesterday
-
pyou started following 3dpolyline Triangle with 4 vertices
-
Hi all I have many Closed 3dpolyline Triangles with 4 vertices each. Would it be possible with the help of lisp command to track all triangles and remove duplicates, please? Its the first and second vertices with same position. Thank you
-
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Final edit to prevent the dialog from asking unnecessary questions. Remember: the LISP commands it will remember will be those that have been executed at some point. (defun fota (/ arch cad cmd mens) (defun pregunta (a b / cad) (cond ((= (car b) "CLOSE") (if (and *lstCmds* (setq mens (cmdsCargados)) (= (vlax-invoke-method (vlax-create-object "wscript.shell") 'popup "Print commands on screen?" 0 "Nikon's doubts" 4) 6) ) (vla-AddMText (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) (vlax-3d-point (getpoint "\nInsertion point...")) 100 mens) ) ) ((= (type a) 'VLR-Lisp-Reactor) (if (not (member (setq cad (substr (car b) 4 (- (strlen (car b)) 4))) *lstCmds*)) (setq *lstCmds* (cons (substr (car b) 4 (- (strlen (car b)) 4)) *lstCmds*)) ) ) ) ) (foreach sim (atoms-family 0) (if (wcmatch (setq cmd (strcase (vl-princ-to-string sim) T)) "c:*") (setq *afI* (cons sim *afI*)) ) ) (setq *r* (vlr-command-reactor nil '((:vlr-commandwillStart . pregunta)))) (setq *r1* (vlr-lisp-reactor nil '((:vlr-lispwillstart . pregunta)))) ) (defun cmdsCargados (/ cad) (setq *cadCmds* nil) (foreach sim (atoms-family 0) (if (not (member sim *afI*)) (if (and (wcmatch (setq cad (strcase (vl-princ-to-string sim) T)) "c:*") (member (strcase (substr cad 3)) *lstCmds*) ) (setq *cadCmds* (strcat (if *cadCmds* (strcat *cadCmds* "\n") "\\C1Commands loaded during last sesion:\\C256\n") (substr cad 3))) ) ) ) *cadCmds* ) (fota) -
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Thanks for the suggestion, @Steven P I'll look into it. -
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
I think it's a good idea that I'm also going to try: leaving a text box with the names of the Lisp commands used to edit a drawing. This new code will filter all of AutoCAD's predefined Lisp commands and, of those loaded by the user, will only consider those that have been used in the drawing. To avoid confusion, replace everything above with this new one. (defun fota (/ arch cad cmd) (defun pregunta (a b / cad) (cond ((= (car b) "CLOSE") (if (and *lstCmds* (= (vlax-invoke-method (vlax-create-object "wscript.shell") 'popup "Print commands on screen?" 0 "Nikon's doubts" 4) 6)) (c:cmdsCargados)) ) ((= (type a) 'VLR-Lisp-Reactor) (if (not (member (setq cad (substr (car b) 4 (- (strlen (car b)) 4))) *lstCmds*)) (setq *lstCmds* (cons (substr (car b) 4 (- (strlen (car b)) 4)) *lstCmds*)) ) ) ) ) (foreach sim (atoms-family 0) (if (wcmatch (setq cmd (strcase (vl-princ-to-string sim) T)) "c:*") (setq *afI* (cons sim *afI*)) ) ) (setq *r* (vlr-command-reactor nil '((:vlr-commandwillStart . pregunta)))) (setq *r1* (vlr-lisp-reactor nil '((:vlr-lispwillstart . pregunta)))) ) (defun c:cmdsCargados (/ cad arch linea) (setq *cadCmds* nil) (foreach sim (atoms-family 0) (if (not (member sim *afI*)) (if (and (wcmatch (setq cad (strcase (vl-princ-to-string sim) T)) "c:*") (member (strcase (substr cad 3)) *lstCmds*) ) (setq *cadCmds* (strcat (if *cadCmds* (strcat *cadCmds* "\n") "\\C1Commands loaded during last sesion:\\C256\n") (substr cad 3))) ) ) ) (if *cadCmds* (vla-AddMText (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) (vlax-3d-point (getpoint "\nInsertion point...")) 100 *cadCmds*)) (princ) ) (fota) -
효천순천 started following SuperBoundary • The superior boundary creation tool
-
I have about 50 lisp programs in startup. I upload the rest as needed. I have a list of autoload programs of this type (_autoload "MTxt")(c:MTxt). Many teams have pseudonyms in acad.pgp. I just want the list of used programs to remain in the drawing. Lee Mac's LISPLogV1-0.lsp program does what I need, only in a .csv file.
-
효천순천 started following Debalance
-
Steven P started following Get a list of used AutoLISP commands
-
Get a list of used AutoLISP commands
Steven P replied to Nikon's topic in AutoLISP, Visual LISP & DCL
300 Lisp programmes... If you have the time, create this: (defun recordLISP (LispName / ) (if (= LispsList nil) ; check if list exits (progn (setq LispsList (list LispName)) ; create new list, add text string to it ) ; end progn (progn (setq LispsList (cons LispName LispsList)) ; add LispName to LispsList ) ; end progn ) ; end IF ) (defun c:MySave ( / ) (defun MakeMText (pt TxtString) (entmakex (list (cons 0 "MTEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbMText") (cons 10 pt) (cons 1 TxtString) )) ; end Entmakex, End List ) ; end MakeMText (defun LM:lst->str ( lst del ) (if (cdr lst) (strcat (car lst) del (LM:lst->str (cdr lst) del)) (car lst) ) ) (MakeMText (GetPoint "Enter Insert Point") (LM:lst->str (reverse LispsList) "\\P")) ) and for every LISP you want to record add this line (recordLISP "-LISPNAME-") A little over the top maybe, but you get to control what LISPs you really want to record. For example, I have a couple of shortcuts, for example "ZA" for Zoom All, "PlotPDF" to plot a PDF - neither of these examples are a part of the process to create a drawing, where others such as "CTX+" - Copy Text, increment by 1 is, I might want to record that. If you LISP library is like mine you could probably cut 50 or so off that 300 LISPs as unnecessary to record think. I am curious what the end result you want to do is, once you have listed the commands you use, you can recreate process to create the drawing, but perhaps without also knowing mouse clicks and keyboard entries not a lot else? -
효천순천 joined the community
-
SuperBoundary • The superior boundary creation tool
효천순천 reviewed Debalance's file in Programs and Scripts
-
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
@NikonI think there's an easier and more definitive way. Wait. -
I saved this code in acad2021Doc.lsp
-
I open a new file, download, for example, 3 lisps, but when I close it, the text is saved indicating the number of programs, more than 3. In my opinion, programs that are in startup are being displayed...
-
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Once you've done this, after opening any drawing, the code will be loaded, and when you close the drawing, it should prompt you for a location point for an MTEXT with the loaded commands. The only question I have is whether it's better to save this code in acad####Doc.lsp or acad####.lsp. -
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
How to make it work? Locate your acad**doc.lsp file and copy the code at the end of the original code, but before any code you may have added yourself. Try it. -
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
This could be one way to do it: (defun fota (/ arch cad cmd) (defun pregunta (a b) (if (= (car b) "CLOSE") (if (= (vlax-invoke-method (vlax-create-object "wscript.shell") 'popup "Print commands on screen?" 0 "Nikon's doubts" 4) 6) (c:cmdsCargados)))) (foreach sim (atoms-family 0) (if (wcmatch (setq cmd (strcase (vl-princ-to-string sim) T)) "c:*") (setq *afI* (cons sim *afI*)) ) ) (setq *r* (vlr-command-reactor nil '((:vlr-commandwillStart . pregunta)))) ) (defun c:cmdsCargados (/ cad cadCmds arch linea) (foreach sim (atoms-family 0) (if (not (member sim *afI*)) (if (wcmatch (setq cad (strcase (vl-princ-to-string sim) T)) "c:*") (setq cadCmds (strcat (if cadCmds (strcat cadCmds "\n") "\\C1Commands loaded during last sesion:\\C256\n") (substr cad 3))) ) ) ) (if cadCmds (vla-AddMText (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) (vlax-3d-point (getpoint "\nInsertion point...")) 100 cadCmds)) (princ) ) (fota) -
I often have to go back to old drawings. I have over 300 lisp programs. I would like the drawing to have a list of programs used to continue working, but over time it is not always possible to remember the name of the desired program.
-
LISPLogV1-0.lsp is a very convenient program. Thanks @Lee Mac. Is it possible to get a list of lisp commands in the drawing? That is, when saving a drawing, a request appears: "Save a list of lisp commands?" and the text with the commands is inserted into the drawing?