- (defun c:kg (/ WMP CD n nn yn)
- (setq WMP (vlax-create-object "WMPlayer.ocx"))
- (setq CD (vlax-get WMP 'CDRomCollection))
- (setq nn (vlax-get CD 'Count))
- (setq n 0)
- (repeat nn
- (vlax-invoke (vla-item CD n) 'Eject)
- (setq n (1+ n))
- )
- (setq n 0)
- (repeat nn
- (initget 1 "Y N")
- (setq yn (getkword (strcat "\n是否关闭" (vlax-get (vla-item CD n) 'DriveSpecifier) "盘?[是(Y)/否(N)]:")))
- (if (= yn "Y") (vlax-invoke (vla-item CD n) 'Eject))
- (setq n (1+ n))
- )
- (princ)
- )
|