您好,我的建议是使用activeX方法
- (vl-load-com)
- (setq *acDoc* (vla-get-activedocument (vlax-get-acad-object)))
- (defun test (/ wc ss vw)
- (if (and (setq wc (mapcar ''((f) (mapcar f (getvar "viewctr") '(5. 5. 0.))) '(- +))
- ss (apply 'ssget (cons "_C" wc))
- )
- (setq vw (vla-get-activeviewport *acdoc*))
- )
- (progn (vlax-put vw 'direction '(0. 0. 1.))
- (vla-put-activeviewport *acdoc* vw)
- (apply 'vla-zoomwindow (cons (vlax-get-acad-object) (mapcar 'vlax-3d-point wc)))
- )
- )
- (princ)
- )
- (vlax-add-cmd "test" 'test "test" 1)
- ;reference: Dev.Documentation
- ;ACRX_CMD_MODAL (0) Command cannot be invoked while another command is active.
- ;ACRX_CMD_TRANSPARENT (1) Command can be invoked while another command is active.
- ;ACRX_CMD_USEPICKSET (2) When the pickfirst set is retrieved it is cleared within AutoCAD.
- ; Command will be able to retrieve the pickfirst set. Command cannot retrieve or set grips.
- ;ACRX_CMD_REDRAW (4)
您是否在发出透明命令时添加了前缀“引号”(撇号)?
或
我记得类似于ortho 45的“透明”,但没有使用“vlax add cmd”,只是通过调用要包含括号的符号的函数
示例:(测试)(dd)等。。
|