Author Topic: Drawing log application  (Read 9512 times)

0 Members and 1 Guest are viewing this topic.

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Drawing log application
« Reply #15 on: April 05, 2006, 01:57:12 PM »
Code: [Select]
(defun c:acad_log (/)
 (vlr-remove-all)
 (defun my_reac ()
  (vlr-command-reactor nil '((:vlr-commandended . st_com)))
 ) ;_  defun
 (defun st_com (a1 a2 / f)
  (setq f (open "D:\\acad_log.txt" "a"))
  (write-line (car a2) f)
  (close f)
 ) ;_  defun
  (my_reac)
)

GDF

  • Water Moccasin
  • Posts: 2081
Re: Drawing log application
« Reply #16 on: April 05, 2006, 03:55:45 PM »
Code: [Select]
(defun c:acad_log (/)
 (vlr-remove-all)
 (defun my_reac ()
  (vlr-command-reactor nil '((:vlr-commandended . st_com)))
 ) ;_  defun
 (defun st_com (a1 a2 / f)
  (setq f (open "D:\\acad_log.txt" "a"))
  (write-line (car a2) f)
  (close f)
 ) ;_  defun
  (my_reac)
)

You could add this to it.......

Code: [Select]
;;;Elpanov Evgeniy
(defun c:acad_log (/)
  (vlr-remove-all)
  (defun my_reac ()
    (vlr-command-reactor nil '((:vlr-commandended . st_com)))
  ) ;_  defun
  (defun st_com (a1 a2 / f xdate mo day yr hr mn dg us)
    (setq f (open "C:\\temp\\acad_log.txt" "a"))
    (setq  XDATE (rtos (getvar "cdate") 2 4)
MO   (substr XDATE 5 2)
DAY  (substr XDATE 7 2)
YR   (substr XDATE 1 4)
HR   (substr XDATE 10 2)
MN   (substr XDATE 12 2)
DG   (getvar "dwgname")
US   (substr (getvar "loginname") 1 5)      
    )
    (write-line (strcat MO "/" DAY "/" YR " " HR ":" MN " " DG " " US "\t" "Command-Line: " (car a2)) f)
    ;;(write-line (car a2) f)
    (close f)
  ) ;_  defun
  (my_reac)
)

Gary
« Last Edit: April 05, 2006, 04:18:03 PM by Gary Fowler »
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64


ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Drawing log application
« Reply #18 on: April 06, 2006, 03:32:22 AM »
Code: [Select]
(defun c:acad_log (/)
  (vlr-remove-all)
  (defun my_reac ()
    (vlr-command-reactor nil '((:vlr-commandended . st_com)))
  ) ;_  defun
  (defun st_com (a1 a2 / f xdate mo day yr hr mn dg us)
    (setq f (open "D:\\TMP\\acad_log.xls" "a"))
    (write-line
      (strcat
(menucmd "M=$(edtime,$(getvar,date),MO.DD.YY\tHH:MM:SS\t)")
(getvar "dwgname")
"\t"
(getvar "loginname")
"\tCommand:\t"
(car a2)
      ) ;_  strcat
      f
    ) ;_  write-line
    (close f)
  ) ;_  defun
  (my_reac)
) ;_  defun

GDF

  • Water Moccasin
  • Posts: 2081
Re: Drawing log application
« Reply #19 on: April 06, 2006, 09:25:21 AM »
Thanks Elpanov

Here is another version:
Code: [Select]
;;;To record lisp commands typed in from key board.
;;;by Elpanov Evgeniy
(defun c:Record (/) 
  (defun padout  (word len / spaces)
    (repeat (- len (strlen word)) (setq spaces (cons 32 spaces)))
    (strcat word (vl-list->string spaces))
  ) ;;by Allen Butler
  ;;(vlr-remove-all)  <--don't want this!!
  (defun RecordCommands (a1 a2 / f tm dg us)
    (setq f (open "C:\\temp\\RecordCommands.txt" "a"))
    (setq    TM   (menucmd "M=$(edtime,$(getvar,date),MO/DD/YYYY\tHH:MM\t)")
DG   (strcat (getvar "dwgprefix")(getvar "dwgname"))
US   (substr (getvar "loginname") 1 7)
    )
    (write-line (strcat "Command: " (padout (car a2) 9) "\t\t" TM "\t" US "\t" DG) f)     
    (close f)
  )
  (vlr-command-reactor nil '((:vlr-commandended . RecordCommands)))
  (princ "\n*** --------- Recording Commands --------- ***") 
  (princ)
)

Gary
« Last Edit: April 06, 2006, 09:43:57 AM by Gary Fowler »
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

ElpanovEvgeniy

  • Water Moccasin
  • Posts: 1569
  • Moscow (Russia)
Re: Drawing log application
« Reply #20 on: April 06, 2006, 10:01:34 AM »
Thanks Gary
I has removed superfluous variables... :-)
Code: [Select]
(defun c:Record (/)
 (defun padout (word len / spaces)
  (repeat (- len (strlen word)) (setq spaces (cons 32 spaces)))
  (strcat word (vl-list->string spaces))
 ) ;_  defun
 (vlr-remove-all)
 (defun RecordCommands (a1 a2 / f)
  (write-line
   (strcat
    "Command: "
    (padout (car a2) 9)
    "\t"
    (menucmd "M=$(edtime,$(getvar,date),MO/DD/YYYY\tHH:MM\t)")
    (substr (getvar "loginname") 1 7)
    "\t"
    (getvar "dwgprefix")
    (getvar "dwgname")
   ) ;_  strcat
   (setq f (open "D:\\TMP\\RecordCommands.txt" "a"))
  ) ;_  write-line
  (close f)
 ) ;_  defun
 (vlr-command-reactor nil '((:vlr-commandended . RecordCommands)))
 (princ "\n*** --------- Recording Commands --------- ***")
 (princ)
) ;_  defun
" ;;by Allen Butler"
Who it?

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Drawing log application
« Reply #21 on: April 06, 2006, 10:24:11 AM »
Allen is CAB
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Drawing log application
« Reply #22 on: April 06, 2006, 10:35:51 AM »
If I'm not mistaken Alan is CAB (Charles Alan Butler).

:)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Drawing log application
« Reply #23 on: April 06, 2006, 10:46:27 AM »
Yes, and I only provided this function for Gary some time back.
Code: [Select]
(defun padout  (word len / spaces)
    (repeat (- len (strlen word)) (setq spaces (cons 32 spaces)))
    (strcat word (vl-list->string spaces))
  ) ;;by Alan Butler

Here it is:
http://www.theswamp.org/index.php?topic=8661.msg110575#msg110575
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Drawing log application
« Reply #24 on: April 06, 2006, 11:02:38 AM »
Yes, and I only provided this function for Gary some time back.
Code: [Select]
(defun padout  (word len / spaces)
    (repeat (- len (strlen word)) (setq spaces (cons 32 spaces)))
    (strcat word (vl-list->string spaces))
  ) ;;by Alan Butler

Here it is:
http://www.theswamp.org/index.php?topic=8661.msg110575#msg110575

Sorry Alan <alais Allen> my spelling is not the beest.

Garry
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Drawing log application
« Reply #25 on: April 06, 2006, 12:09:08 PM »
...
Sorry Alan <alais Allen> my spelling is not the beest.

Garry

Heh!? Apparently, neither is mine. Sorry man.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Drawing log application
« Reply #26 on: April 06, 2006, 01:50:49 PM »
No problem, I even answer to 'Hey You'.
Although I'm not fond of Charlie. :-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Drawing log application
« Reply #27 on: April 06, 2006, 02:09:18 PM »
No problem, I even answer to 'Hey You'.
Although I'm not fond of Charlie. :-)

'Hey You' is probably taken...sounds like a forum screen name to me.

Gary
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64