Chuyển đến nội dung
Diễn đàn CADViet
Đăng nhập để thực hiện theo  
nguyenvinh5779

nhờ các chinh sửa lisp ,

Các bài được khuyến nghị

Mình có download lisp trên mạng 

Lisp chuyenn từ model sang layout , và từ layout này sang layout khác

Do nhu cau cong việc làm trên layout nhiều 

Nen mình xin nho các bạn chinh giúp chuyển từ layout nay sang layout khác mà khong chuyen sang model !

Xin cam on 

zv.lsp

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác
32 phút trước, nguyenvinh5779 đã nói:

Mình có download lisp trên mạng 

Lisp chuyenn từ model sang layout , và từ layout này sang layout khác

Do nhu cau cong việc làm trên layout nhiều 

Nen mình xin nho các bạn chinh giúp chuyển từ layout nay sang layout khác mà khong chuyen sang model !

Xin cam on 

zv.lsp

Sửa cho bạn nhé:

lệnh CLa

;; Created by: Lee Ambrosius
;; Date Written: 12/11/03

;; Includes four commands which can be redefined.
;; NextLayout - Navigates to the right and will wrap around
;;              to the left side once the end is reached

;; PreviousLayout - Navigates to the left and will wrap around
;;                  to the right side once the end is reached

;; FirstLayout - Navigates to the left most tab

;; LstLayout - Navigates to the right most tab

;; Gets a listing of all Layouts in the drawing
(defun Get-Layout-List( / acadObj acDoc acDocLayouts layoutCount loopCount
                         layoutListLocal layoutListSorted layoutName layoutPosition
                         loopCountSorted)
 (vl-load-com)
 (setq acadObj (vlax-get-acad-object))
 (setq acDoc (vlax-get-property acadObj 'ActiveDocument))
 (setq acDocLayouts (vlax-get-property acDoc 'Layouts))

 (setq layoutCount (vlax-get-property acDocLayouts 'Count)
       loopCount 0
       layoutListLocal (list)
       layoutListSorted (list)
 )
 
 (while (> layoutCount loopCount)
   (setq layoutName (vlax-get-property (vlax-invoke-method acDocLayouts 'Item loopCount) 'Name))
   (setq layoutPosition (vlax-get-property (vlax-invoke-method acDocLayouts 'Item loopCount) 'TabOrder))

   (setq layoutListLocal (append layoutListLocal (list (list layoutPosition layoutName))))
   (setq loopCount (1+ loopCount))
 )

 ;; Resort listing by TabOrder
 (setq layoutCountSorted 0)
 (while (> (length layoutListLocal) (length layoutListSorted))
   (setq loopCountSorted 0)
   (foreach layoutLocation layoutListLocal
     (progn
       (if (and (= (car layoutLocation) (length layoutListSorted)) (= (car layoutLocation) layoutCountSorted))
         (progn
           (setq layoutListSorted (append layoutListSorted (cdr (nth loopCountSorted layoutListLocal))))
       (setq layoutCountSorted (1+ layoutCountSorted))
         )
       )
       (setq loopCountSorted (1+ loopCountSorted))
     )
   )
 )
 layoutListSorted
)

(defun c:ll ( / layout-mem-list layout-list layoutLocation)
 (setq layoutLocation 0)
 (setq layout-list (get-layout-list))
 (setq layout-mem-list (member (getvar "CTAB") layout-list))
 (if layout-mem-list
   (progn
     (setq layoutLocation (- (length layout-list) (length layout-mem-list)))
   )
   (setq layoutLocation (1+ layoutLocation))
 )
 (if (>= (1+ layoutLocation) (length layout-list))
   (setvar "CTAB" (nth 0 layout-list))
   (setvar "CTAB" (nth (1+ layoutLocation) layout-list))
 )
)

(defun c:lll ( / layout-mem-list layout-list layoutLocation)
 (setq layoutLocation 0)
 (setq layout-list (get-layout-list))
 (setq layout-mem-list (member (getvar "CTAB") layout-list))
 (if layout-mem-list
   (progn
     (setq layoutLocation (- (length layout-list) (length layout-mem-list)))
   )
   (setq layoutLocation (1- layoutLocation))
 )
 (if (= layoutLocation 0)
   (setvar "CTAB" (nth (1- (length layout-list)) layout-list))
   (setvar "CTAB" (nth (1- layoutLocation) layout-list))
 )
)

(defun c:llll ( / layout-list layoutLocation)
 (setvar "CTAB" (nth 0 (get-layout-list)))
)

(defun c:LastLayout ( / layout-list)
 (setq layout-list (get-layout-list))

 (setvar "CTAB" (nth (- (length layout-list) 1) layout-list))
)
(defun c:cla ( / layout-mem-list layout-list layoutLocation)
 (setq layoutLocation 0)
 (setq layout-list (get-layout-list))
 (setq layout-mem-list (member (getvar "CTAB") layout-list))
 (if layout-mem-list
   (progn
     (setq layoutLocation (- (length layout-list) (length layout-mem-list)))
   )
   (setq layoutLocation (1+ layoutLocation))
 )
 (if (>= (1+ layoutLocation) (length layout-list))
   (setvar "CTAB" (nth 1 layout-list))
   (setvar "CTAB" (nth (1+ layoutLocation) layout-list))
 )
)
(princ)

 

  • Like 1

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác

Tạo một tài khoản hoặc đăng nhập để nhận xét

Bạn cần phải là một thành viên để lại một bình luận

Tạo tài khoản

Đăng ký một tài khoản mới trong cộng đồng của chúng tôi. Điều đó dễ mà.

Đăng ký tài khoản mới

Đăng nhập

Bạn có sẵn sàng để tạo một tài khoản ? Đăng nhập tại đây.

Đăng nhập ngay
Đăng nhập để thực hiện theo  

×