phongphong Posted December 25, 2020 Posted December 25, 2020 (defun C:cc( / taphop soluong khung index) (setq ss (ssget (LIST (CONS 0 "POLYLINE,LWPOLYLINE")))) (setq length (sslength ss)) (setq index 0) (while (< index length) (vl-cmdf "_.copybase" '(0 0 0) (ssname ss index) "") (vl-cmdf "layout" "S" "Layout1") (vl-cmdf "_.pasteclip" '(0 0 0)) (setq index (+ index 1)) ) (princ) ) Can someone tell me why I can't copy multiple objects to Paper Space, the above code works fine with model space but with Paper Space it always copies the first object and multiplies in the loop. Thanks for any help. Quote
Tharwat Posted December 26, 2020 Posted December 26, 2020 (edited) Be sure to have the layout name Layout1 available among the layout list of your drawing otherwise no action would be taken. (defun c:cc (/ ss) (if (setq ss (ssget '((0 . "POLYLINE,LWPOLYLINE")))) (progn (vl-cmdf "_.copybase" "_none" '(0 0 0) ss "") (vl-cmdf "layout" "S" "Layout1") (vl-cmdf "_.pasteclip" "_none" '(0 0 0)) ) ) (princ) ) Edited December 26, 2020 by Tharwat Forgot to add the codes. lol 1 Quote
phongphong Posted December 26, 2020 Author Posted December 26, 2020 1 giờ trước, Tharwat nói: Đảm bảo có sẵn tên bố cục Layout1 trong danh sách bố cục của bản vẽ của bạn nếu không sẽ không có hành động nào được thực hiện. Cảm ơn Tharwat đã dành thời gian giúp đỡ tôi. Nhưng tôi cần nó với "while" để làm một số việc khác. bạn có thể giúp tôi Quote
phongphong Posted December 28, 2020 Author Posted December 28, 2020 35 minutes ago, Tharwat said: Please post your replies in English. Thank you Tharwat for taking the time to help me. But I need it with "while" to do some other work. Can you help me Quote
Tharwat Posted December 28, 2020 Posted December 28, 2020 (vl-cmdf "_.copybase" "_none" '(0 0 0) (ssadd (ssname ss index)) "") 1 Quote
phongphong Posted December 28, 2020 Author Posted December 28, 2020 (edited) Thank you very much Tharwat Edited December 28, 2020 by phongphong Quote
Tharwat Posted December 28, 2020 Posted December 28, 2020 1 minute ago, phongphong said: Thank you very much Tharwat You're welcome anytime. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.