Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

LISP on MAC, New for me, did a bunch on windows side 20 years ago need help getting started again

tkollarAB2B9
Explorer

LISP on MAC, New for me, did a bunch on windows side 20 years ago need help getting started again

tkollarAB2B9
Explorer
Explorer

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)

 

0 Me gusta
Responder
Soluciones aceptadas (1)
426 Vistas
3 Respuestas
Respuestas (3)

maxim_k
Consultant
Consultant
Solución aceptada

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

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Me gusta

maxim_k
Consultant
Consultant
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

MacACAD | Linkedin

Etiquette and Ground Rules of Autodesk Community
0 Me gusta

tkollarAB2B9
Explorer
Explorer

Thank you!

worked great. 

Looks like I was very close just need to be a bit more careful

0 Me gusta