Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello guys,
CAD file have 3 graphics in area (0:0) to (50:50), I want one lisp command to perform three layer simultaneous copies and moves. How to modify below lisp to do automatically copy?
layer names 1, 2, and 3.
Layer 1 needs to be copied and offset horizontally by 50mm along the X-axis,
layer 2 needs to be copied and offset vertically by 50mm along the Y-axis,
layer 3 needs to be copied and offset horizontally by 50mm along the X-axis and vertically by 50mm along the Y-axis.
(defun c:CopyAndOffsetLayers (/ ss1 ss2 ss3)
(setq ss1 (ssget '((0 . "CIRCLE,LINE,*") (8 . "1"))))
(if ss1
(progn
(command "_.copy" ss1 "" "_non" '(50 0))
(princ "\nlayer1Xoffset50\n")
)
)
(setq ss2 (ssget '((0 . "CIRCLE,LINE,*") (8 . "2"))))
(if ss2
(progn
(command "_.copy" ss2 "" "_non" '(0 50))
(princ "\nlayer2Yoffset50\n")
)
)
(setq ss3 (ssget '((0 . "CIRCLE,LINE,*") (8 . "3"))))
(if ss3
(progn
(command "_.copy" ss3 "" "_non" '(50 50))
(princ "\nlayer3X&Yoffset50\n")
)
)
(princ)
)
(princ "\nCOPYANDOFFSETLAYERS\n")
(princ)
Solved! Go to Solution.