王咣生 发表于 2003-12-29 14:10:00

为什么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)
    )
)
)

龙龙仔 发表于 2004-1-2 13:02:00

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))
)

无痕 发表于 2004-1-2 14:59:00

龙版主,你的程序真多:p
能贴一段如何用vl构造块的程序么?

龙龙仔 发表于 2004-1-2 16:58:00

查看
http://bbs.mjtd.com/forum.php?mod=viewthread&tid=4421

jiheng 发表于 2009-12-18 16:03:00

<p>&nbsp;把 (vla-activate layout) 改为 </p><p>(vla-put-activelayout (vla-get-activedocument (vlax-get-acad-object)) layout)<br/><br/></p>
页: [1]
查看完整版本: 为什么vla-activate不能用?