All Activity
- Past hour
-
Like @Lee Mac a simple change layouts script file. (command "Script" "myviews") (setvar 'ctab "D01") zoom e delay 500 (setvar 'ctab "D02") zoom e delay 500 (alert "All done")
-
Agree with @CyberAngel press a button and get volumes again. Yes may have to add sections in the road for change of shape. Again software like Civil Site Design allows multi string design so small sections of road can be changed and auto volumes then. Think Bus bays & turn slots.
-
arian joined the community
- Today
-
temiz joined the community
-
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Yes. It's an option -
*********************************************************************** When I use lisp commands, I always wish the developers all the best. Thank you so much for your hard work and enthusiasm. Thanks to your programs, routine work turns into pleasure. And it takes much less time to create drawings. **********************************************************************
-
switch to turn on or off a variable
GLAVCVS replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
Another way, taking advantage of @Lee Mac's idea and condensing an output message for the user (defun c:sf (/ v) (princ (strcat "\n*** " (setq v "UCSFOLLOW") (nth (setvar v (- 1 (getvar v))) '(" desactivado" " activado")))) (princ) ) -
I issuing several commands in LISP during the session before saving. *** I've started the last reactor. Thanks a lot, the code works!
-
Get a list of used AutoLISP commands
Lee Mac replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Update to aggregate the logs - (defun init ( ) (foreach grp (vlr-reactors :vlr-command-reactor :vlr-lisp-reactor) (foreach rtr (cdr grp) (if (= "lisp-commands" (vlr-data rtr)) (vlr-remove rtr) ) ) ) (setq lisp-command-list nil) (vlr-command-reactor "lisp-commands" '((:vlr-commandwillstart . onsave))) (vlr-lisp-reactor "lisp-commands" '((:vlr-lispwillstart . onlisp))) (princ) ) (defun onsave ( rtr arg / ent enx idx lyr mts sel str ) (setq lyr "lisp-commands") (cond ( (not arg)) ( (not (wcmatch (setq arg (strcase (car arg))) "SAVE,QSAVE,SAVEAS"))) ( lisp-command-list (if (setq sel (ssget "_X" (list (cons 8 lyr)))) (repeat (setq idx (sslength sel)) (setq idx (1- idx) ent (ssname sel idx) enx (entget ent) ) (if (= "MTEXT" (cdr (assoc 0 enx))) (setq mts (cdr (assoc 1 enx))) ) (entdel ent) ) ) (if mts (setq lisp-command-list (mergelists (parsetext mts) lisp-command-list))) (setq str "") (foreach itm (vl-sort lisp-command-list '(lambda ( a b ) (> (cdr a) (cdr b)))) (setq str (strcat str "\\P" (car itm) "\t\t" (itoa (cdr itm)))) ) (makelayer lyr) (entmakex (list '(0 . "MTEXT") '(100 . "AcDbEntity") '(100 . "AcDbMText") '(010 0.0 0.0) (cons 1 (substr str 3)) (cons 8 lyr) ) ) (setq lisp-command-list nil) ) ) (princ) ) (defun onlisp ( rtr arg / fun itm ) (cond ( (not arg)) ( (wcmatch (setq arg (strcase (car arg))) "~(C:*)")) ( (setq fun (substr arg 4 (- (strlen arg) 4)) itm (assoc fun lisp-command-list) ) (setq lisp-command-list (subst (cons (car itm) (1+ (cdr itm))) itm lisp-command-list)) ) ( (setq lisp-command-list (cons (cons fun 1) lisp-command-list))) ) (princ) ) (defun makelayer ( lay ) (if (not (tblobjname "layer" lay)) (entmake (list '(0 . "LAYER") '(100 . "AcDbSymbolTableRecord") '(100 . "AcDbLayerTableRecord") '(070 . 0) (cons 2 lay) '(062 . 8) '(290 . 0) ) ) ) ) (defun parsetext ( str / pos ) (cond ( (setq pos (vl-string-search "\\P" str)) (append (parsetext (substr str 1 pos)) (parsetext (substr str (+ pos 3)))) ) ( (setq pos (vl-string-position 9 str)) (list (cons (substr str 1 pos) (atoi (substr str (+ pos 3))))) ) ) ) (defun mergelists ( ls1 ls2 / ass ) (if (< (length ls1) (length ls2)) (mapcar 'set '(ls1 ls2) (list ls2 ls1)) ) (foreach itm ls2 (if (setq ass (assoc (car itm) ls1)) (setq ls1 (subst (cons (car itm) (+ (cdr ass) (cdr itm))) ass ls1)) (setq ls1 (cons itm ls1)) ) ) ls1 ) (vl-load-com) (init) -
Maycon Vieira joined the community
-
Obed26 joined the community
-
Lee Mac started following Open named viewports with lisp
-
Try the DELAY command - the argument represents a time in millisecs.
-
Get a list of used AutoLISP commands
Lee Mac replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Are you issuing some LISP commands during the session before saving? -
switch to turn on or off a variable
leonucadomi replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
What I'm looking for is not to have a routine that turns it on and one that turns it off, but rather a single routine that, like a roulette wheel, allows me to change the state of the variable just with enter -
switch to turn on or off a variable
leonucadomi replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
I do it by repeating it 100 times because I don't know how to make a routine repeat itself indefinitely until I execute escape. -
Get a list of used AutoLISP commands
Steven P replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Did he say earlier to only record commands that the user initiates rather than any automatically running on opening a drawing? In which case maybe save it in a file "ZZZ.LSP" or something similar so it is loaded last (Assuming here that custom LISP files load alphabetically this will load last - I am not sure if they do or not though), and put the file in the trusted files location. -
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
To settle this matter I must say yes: it is better to write the code in "acad.lsp" provided that there is not already custom lisp code in "acad####.lsp" or "acad####DOC.lsp", because if so, that code would escape the control of the "fota" function. I must say that I have the bad habit of writing code both in "acad####.lsp" and in "acad####DOC.lsp". Simply as a matter of economy. Lastly, the "ACADLSPASDOC" variable affects only "acad.lsp" but not "acad####.lsp", as it might seem -
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
The code needs to be loaded before any other code you need to memorize. For this reason, saving it at the beginning of the "acad2021.lsp" file allows the code to control other programs loaded later from the same "acad2021.lsp" or "acad2021Doc.lsp." If you load it after other files, it will discard any previously loaded Lisp commands and only consider those loaded later. Therefore, yes, you can save it in a separate file and load it whenever you need, but you must be aware of this condition. Are you willing to accept it? -
I have ACADLSPASDOC=0. I have another question: Is it possible to use your code as a separate reactor without adding it to the acad20##.lsp file?
-
I can't understand why your code (defun init ( )... it doesn't work for me. Is there a problem with the localization of Autocad? Do I need to change this line?: ( (not (wcmatch (setq arg (strcase (car arg))) "SAVE,QSAVE,SAVEAS"))) to ( (not (wcmatch (setq arg (strcase (car arg))) "SAVE,QSAVE,SAVEAS,_SAVE,_QSAVE,_SAVEAS"))) Or something else? Can anyone check the code?
-
This might be a stupid question, but could it be easier to generate the table all over again? In some cases (especially with Civil 3D) it's faster to start over than to try editing the table.
-
nubrinnah joined the community
-
Get a list of used AutoLISP commands
GLAVCVS replied to Nikon's topic in AutoLISP, Visual LISP & DCL
In theory, it should be that way. But in practice, it's not. At least not for me. ClipLM.mp4 Can anyone else on this forum say that the same thing is happening to them? -
these tables are produced by Civil 3D but after exporting section view , you cant updates material tables automatically. sometimes you have to change some areas manually and you need to recalculate volumes and also make corrections to cumulative volumes as well. I myself have written two separate lisps to do that but it need lots of clicks on the tables. I think it wont be very difficult for experts to define the right arrays to read source data and do recalculations and replace all volumes automatically.
-
Get a list of used AutoLISP commands
Lee Mac replied to Nikon's topic in AutoLISP, Visual LISP & DCL
Not just those reactors created "with the previous code", but any reactor defined by any program - this is risky. You cannot guarantee that it runs before any other application is loaded. -
Get a list of used AutoLISP commands
Lee Mac replied to Nikon's topic in AutoLISP, Visual LISP & DCL
The acad20##.lsp and acad20##doc.lsp files should not be modified - these are reserved for the application. Instead, you should create your own acad.lsp and acaddoc.lsp files. Note that, by default, acad.lsp will be loaded once per session, and acaddoc.lsp will be loaded per document (unless ACADLSPASDOC=1, in which case acad.lsp will also be loaded per document). -
Get a list of used AutoLISP commands
Lee Mac replied to Nikon's topic in AutoLISP, Visual LISP & DCL
As I noted in my earlier post: There are no prompts, no commands - the text is output to the drawing when the drawing is saved. -
I quickly tested the code. And it works perfectly! Thank you very much!
-
I saved the reactor with the name onlispsave.lsp, uploaded it to autocad and added it to the startup. But when I close the drawing, there is no reaction to the output of the lisps used. That's why I asked how to use this reactor properly. I use reactors. MTEditReactorV1-1.lsp. And a reactor to create layers for DIM, PLINE, HATCH, LEADER... But in the codes of these reactors there are such lines: (defun c:mteditreactoron nil (defun c:mteditreactoroff nil LISPLogV1-0.lsp (defun c:LispLogON nil (defun c:LispLogOFF nil These reactors are working well for me.
-
soheil joined the community
-
Open named viewports with lisp
Dayananda replied to Dayananda's topic in AutoLISP, Visual LISP & DCL
finally I wrote a script. Now I want to add delay between each views 1954 delay 1955 etc. ^C^C_-view;R;1954;1955;