为什么vla-activate不能用?
为什么vla-activate不能用?(defun ax:ActivateLastLayout (/ i layouts cnt layout)
(vl-load-com)
(setq i -1
layouts (vla-get-layouts
(vla-get-activedocument (vlax-get-acad-object))
)
cnt (1- (vla-get-count layouts))
)
(vlax-for layout layouts
(if (= (vla-get-taborder layout) cnt)
(vla-activate layout)
)
)
) Makes the specified drawing active.
Signature
object.Activate
Object Document ;;對文件使用,不是LAYOUT
The object or objects this method applies to.
;------------------
(defun AX:ACTIVATELASTLAYOUT (/ I LAYOUTS CNT LAYOUT DOC)
(vl-load-com)
(setq LAYOUTS (vla-get-layouts
(setq DOC (vla-get-activedocument (vlax-get-acad-object)))
)
CNT (1- (vla-get-count LAYOUTS))
)
(vla-put-activelayout DOC (vla-item LAYOUTS CNT))
) 龙版主,你的程序真多:p
能贴一段如何用vl构造块的程序么? 查看
http://bbs.mjtd.com/forum.php?mod=viewthread&tid=4421 <p> 把 (vla-activate layout) 改为 </p><p>(vla-put-activelayout (vla-get-activedocument (vlax-get-acad-object)) layout)<br/><br/></p>
页:
[1]