這次是一套歌舞劇的選集, 全都是著名劇集中的歌曲選錄, 共選自廿六齣劇中的四十四首曲子.
2021年11月19日 星期五
2021年11月15日 星期一
都忘記AutoLISP怎麼寫了
數年前(嗯, 應該是數十年前)還在使用AutoCAD時, 為了繪圖效率能提高, 自修AutoLISP並寫了一些小的程式以解決特定問題. 今天在尋找檔案時看到一個昔日的小程式, 它是為了紀錄存檔時間而作, 有點類似在圖紙上留一個戳記, 可作為版本監管之用. 由於是 "解決特定問題" 的原故, 且加上程式很簡短, 所以程式也就沒有所謂結構化, 雖然如此, 但當時用起來還蠻順手, 至少也解決檔案版本的控制問題. 不過如今已不再使用AutoCAD, AutoLISP也都忘了怎麼寫了, 事實上現在回頭看自己寫的程式都有很難理解了.
; Write the save time to the drwaing then save the file
; 2000-06-27 modified to add C:ATSD for command and change AUTOSD to function
; 2000-06-13 created by Ching-che Chen
(defun C:ATSD ()
(autosd)
(princ)
)
(defun AUTOSD (/ p cmde blpm c h)
(setq p (getpoint "\nInput text start point: ")) ; get point from user
(setq cmde (getvar "CMDECHO") blpm (getvar "BLIPMODE"))
(setvar "CMDECHO" 0)
(setvar "BLIPMODE" 0) ; turn off the echo of status
(setq c (getvar "CDATE")) ; get system current date & time
(setq c (rtos c 2 8)) ; transfer the real number to string
(setq h (getvar "DIMTXT")) ; get TEXT height
(setq h (atoi (rtos h))) ; transfer height to integer
(setq h (/ h 3.0)) ; set text height to 1/3 of current height
(command "text" p h 0 c) ; out put text
(setvar "CMDECHO" cmde)
(setvar "BLIPMODE" blpm) ; restore the echo of status
(command "save" "")
(princ)
)
; 2000-06-27 modified to add C:ATSD for command and change AUTOSD to function
; 2000-06-13 created by Ching-che Chen
(defun C:ATSD ()
(autosd)
(princ)
)
(defun AUTOSD (/ p cmde blpm c h)
(setq p (getpoint "\nInput text start point: ")) ; get point from user
(setq cmde (getvar "CMDECHO") blpm (getvar "BLIPMODE"))
(setvar "CMDECHO" 0)
(setvar "BLIPMODE" 0) ; turn off the echo of status
(setq c (getvar "CDATE")) ; get system current date & time
(setq c (rtos c 2 8)) ; transfer the real number to string
(setq h (getvar "DIMTXT")) ; get TEXT height
(setq h (atoi (rtos h))) ; transfer height to integer
(setq h (/ h 3.0)) ; set text height to 1/3 of current height
(command "text" p h 0 c) ; out put text
(setvar "CMDECHO" cmde)
(setvar "BLIPMODE" blpm) ; restore the echo of status
(command "save" "")
(princ)
)
訂閱:
意見 (Atom)
