04-07-2021
08:30 AM
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
04-07-2021
08:30 AM
is there a good guide to getting started in LISP on the MAC side. I am lost LOL.
I have a ton of old Lisp routines I wrote or modified several years ago and I started with a simple one that should add a plot date and time to a drawing. all I get back from AutoCAD is "error: malformed list on input". any input would be welcome. this is not a required thing for me but I just started here as it seamed like a simple starting place
; Stamper - Date/Time Stamp your drawings
;______________________________________________________
(defun C:STAMPER ()
(Prompt "\nSTAMPER -DATE/TIME Stamp your Drawings")
;
;
(setq OLD_CMDECHO (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(Prompt "\nPlease wait while the stamp is updated")appload
;
(setq TEXT_ENTITY (ssget "x"(list(cons 0 "TEXT")(cons 62 7))))
;
(if(Null TEXT_ENTITY)
(progn
(Prompt "\nSTAMP not found, creating it...")
(command ".TEXT" ".25,.25" 0.1 90 "STAMPER")
(setq TEXT_ENTITY (entlast))
(prompt "Complete.\n")
)
)
(setq DATE_TIME (rtos (getvar "CDATE") 2 8))
(setq MONTH (substr DAT_TIME 5 5))
(setq DAY (substr DATE_TIME 7 2))
(setq YEAR (substr DATE_TIME 3 2))
(setq HOUR (substr DATE_TIME 10 2))
(setq MINUTE (substr DATE_TIME 12 2))
(setq NEW_STRING
(strcat "SENT TO PLOTTER ON "YEAR"/"MONTH"/"DAY"/" at "HOUR":"MINUTE")
)
(command ".change" TEXT_ENTITY "" "" "" "" "" "" NEW_STRING)
(command ".chprop" TEXT_ENTITY "" "C" 7 "LA" 0"")
(setvar "CMDECHO" OLD_CMDECHO)
(prompt "Proigram Complete"
(princ)
¡Resuelto! Ir a solución.
04-07-2021
01:03 PM
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
04-07-2021
01:03 PM
Welcome to Autodesk Forums!
Hi @tkollarAB2B9 ,
There are some errors in your code.
Try attached LSP. You can compare it with yours.
Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.
Maxim Kanaev
Architect
MARSS
Etiquette and Ground Rules of Autodesk Community
04-07-2021
11:39 PM
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
04-07-2021
11:39 PM
Hi Tony,
>>>>>is there a good guide to getting started in LISP on the MAC side. I am lost
I'd suggest you "The ABC’s of AutoLISP" by George Omura.
Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.
Maxim Kanaev
Architect
MARSS
Etiquette and Ground Rules of Autodesk Community
>>>>>is there a good guide to getting started in LISP on the MAC side. I am lost
I'd suggest you "The ABC’s of AutoLISP" by George Omura.
Do you find the posts helpful? "LIKE" these posts!
Have your question been answered successfully? Click 'ACCEPT SOLUTION' button.
Maxim Kanaev
Architect
MARSS
Etiquette and Ground Rules of Autodesk Community
04-08-2021
06:06 AM
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Denunciar
04-08-2021
06:06 AM
Thank you!
worked great.
Looks like I was very close just need to be a bit more careful