Lisp Help Please
Lisp Help Please
(OP)
I am trying to devise a LISP routine that, when starting a new drawing the routine will look at the system variables "DWGNAME" and "LOGINNAME", collate the two resultant strings together and then write a blank file(zero bytes)with the name of the empty file being the joined "DWGNAME"+"LOGINNAME". The purpose of this is to monitor which drawings were opened, or created, when and by whom.
I will save this LISP routine to the ACADDOC.LSP on each PC.
Below is as far as I have got, but initially I am having two problems.
1. How do I create one STRING for the file name from the "DWGNAME" & "LOGINNAME" chars.
2. What is the best way to write a blank file to a specific directory. i was thinking of useing the old DOS command COPY CON "filename" ctrl Z.
My code so far:
(setvar "cmdecho" 0)
(setq fname ((getvar "dwgname")+(getvar "Loginname")))
(command "copy con" fname)
Please forgive my simplistic routine, still new into this LISP lark.
Any help would be gratefully received.
The WelshMan
I will save this LISP routine to the ACADDOC.LSP on each PC.
Below is as far as I have got, but initially I am having two problems.
1. How do I create one STRING for the file name from the "DWGNAME" & "LOGINNAME" chars.
2. What is the best way to write a blank file to a specific directory. i was thinking of useing the old DOS command COPY CON "filename" ctrl Z.
My code so far:
(setvar "cmdecho" 0)
(setq fname ((getvar "dwgname")+(getvar "Loginname")))
(command "copy con" fname)
Please forgive my simplistic routine, still new into this LISP lark.
Any help would be gratefully received.
The WelshMan





RE: Lisp Help Please
(setq file (strcat "o:/plot/drawings/" (getvar"loginname") (getvar"dwgname")))
(setq a (open file "w"))
This now creates a new file of zero bytes with the filename made up from the user name and the drawing name every time someone goes into a drawings . These file names are stored in my network drive O:\plos\drawings
Its handy to keep an eye on what everyone is doing.
Regards - The Welshman
RE: Lisp Help Please
Pardal