Jump to content

help with copybase and pasteclip


phongphong

Recommended Posts

(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.

Link to comment
Share on other sites

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 by Tharwat
Forgot to add the codes. lol
  • Like 1
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...