这
- (defun GetMyDocumentsDir()
- (vlax-invoke-method
- (vlax-get-property
- (vlax-create-object "wscript.shell")
- 'SpecialFolders) 'Item "MyDocuments")
- )
- ;;Call:(GetMyDocumentsDir)
- ;;(BF:mkslid sldname 400 300)
- ;;; (SetScreenSize 400 300)
- (defun SetScreenSize (Width height / doc oldsize doc w1 h1 dw dh)
- (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
- (setq oldsize (getvar "SCREENSIZE"))
- (setq W1 (vla-get-width doc))
- (setq H1 (vla-get-Height doc))
- (setq dw (- w1 (car oldsize)))
- (setq dh (- h1 (cadr oldsize)))
- (vla-put-width doc (+ dw width))
- (vla-put-height doc (+ dh height))
- [color="red"] (vla-zoomextents doc)[/color]
- )
- (defun c:test()
- (SetScreenSize 400 300)
- (princ)
- )
; 错误:ActiveX服务器返回错误:未知名称:ZoomExtents |