以下代码应在文件打开、保存和关闭时发出警报。Save和Close可以正常工作,但beginOpen-EndOpen什么都不做。有没有在文件打开时工作的反应堆?我有Autocad 2008。
- [font=Arial][size=2][font=Arial][size=2][font=Courier New][size=2](defun add-reactors( / )
- (vlr-dwg-reactor nil '(
- (:vlr-beginClose . beginCloseCallback)
- (:vlr-beginDwgOpen . beginOpenCallback)
- (:vlr-endDwgOpen . endOpenCallback)
- (:vlr-beginSave . beginSaveCallback)
- (:vlr-saveComplete . saveCompleteCallback)
- )
- )
- )[/size][/font][/size][/font][font=Arial][size=2][font=Courier New][size=2](defun beginCloseCallback(ro args / )
- (princ"\n=====>Aktuelle Zeichnung wird geschlossen")
- (princ "\nTaste drücken\n")
- (read-char)
- (princ)
- )[/size][/font][/size][/font]
- [font=Arial][size=2][font=Courier New][size=2]
- (defun beginOpenCallback(ro args / )
- (princ(strcat "\n=====>Zeichnung " (car args) " soll geöffnet werden"))
- (princ)
- )[/size][/font][/size][/font]
- [font=Arial][size=2][font=Courier New][size=2](defun endOpenCallback(ro args / )
- (princ(strcat "\n=====>Zeichnung " (car args) " wurde geöffnet"))
- (princ)
- )[/size][/font][/size][/font]
- [font=Arial][size=2][font=Courier New][size=2](defun beginSaveCallback(ro args / )
- ;(princ(strcat "\n=====>Aktuelle Zeichnung soll als " (car args) " gespeichert werden"))
- (princ(type(car args))) (terpri)
- (princ)
- )[/size][/font][/size][/font]
- [font=Arial][size=2][font=Courier New][size=2](defun saveCompleteCallback(ro args / )
- ;(princ(strcat "\n=====>Aktuelle Zeichnung wurde als " (car args) " gespeichert"))
- (princ(type(car args))) (terpri)[/size][/font][/size][/font]
- [font=Arial][size=2][font=Courier New][size=2] (princ "\nTaste drücken\n")
- (read-char)
- (princ)
- )[/size][/font][/size][/font]
- [font=Arial][size=2][font=Courier New][size=2]; one shot by load
- (add-reactors[/size][/font][/size][/font]
- [/size][/font]
|