@Michael.Traveller wrote:
....
What could be useful is having a copy up, copy down, copy left, copy right and copy set....
And a third one which is also useful would be able to copy and instantly pan to the new location at the same time ( mixing both codes!)
Here's my take on it. There are commands for merely Panning in the different directions at the specified distance, for merely Copying, and for Copying and also Panning to the location of the copy.
For the Copying ones, you can have object(s) pre-selected or not; it ignores things on locked Layers in either case.
I didn't think there was likely to be a single distance common enough to use as a predetermined initial default value, but that can be added easily. It remembers your distance and offers it as default [only if it exists] so you can see what it was when you go to change it. Use the getCPdist command to set a new one -- it will be called for you automatically the first time you use any of the commands if there's no distance set yet.
I used command names with two C's for the merely-Copy commands, because I already have a custom CL command and I use CR for CiRcle [changing the alias C to be for Copy]. And I used command names with two P's for the merely-Pan commands, because most of the combinations with one are already default aliases. The Copy-and-Pan-to-the-location-of-the-copy commands start with CP [only one each]
(defun C:getCPdist ()
(initget (if *CPdist 6 7)); no zero, no negative, no Enter on first use
(setq *CPdist
(cond
( (getdist
(strcat
"\nCopy/Pan distance"
(if *CPdist (strcat " <" (rtos *CPdist) ">") ""); in current Units mode/precision
": "
); strcat
); getdist
); User-input condition
(*CPdist); prior value on Enter [when allowed]
); cond
); setq
(princ)
); defun
(defun CDD (dir) ; = Copy at Direction and Distance
(if (not *CPdist) (C:getCPdist))
(command "_.copy"
(cond
((ssget "_I") (ssget "_:L-I")); unlocked only among pre-selection if any
((ssget "_:L")); otherwise, unlocked only among new selection
); cond
"" "_non" (polar '(0 0) dir *CPdist) ""
); command
(princ)
); defun
(defun C:CCR () (CDD 0)); = Copy Right
(defun C:CCU () (CDD (/ pi 2))); = Copy Up
(defun C:CCL () (CDD pi)); = Copy Left
(defun C:CCD () (CDD (* pi 1.5))); = Copy Down
(defun PDD (dir); = Pan at Direction and Distance
(command "_.-pan" "_non" (polar '(0 0) dir (- *CPdist)) "")
(princ)
); defun
(defun C:PPR () (PDD 0)); = Pan Right
(defun C:PPU () (PDD (/ pi 2))); = Pan Up
(defun C:PPL () (PDD pi)); = Pan Left
(defun C:PPD () (PDD (* pi 1.5))); = Pan Down
(defun CPDD (dir); = Copy & Pan at Direction and Distance
(CDD dir)
(PDD dir)
(princ)
); defun
(defun C:CPR () (CPDD 0)); = Copy & Pan Right
(defun C:CPU () (CPDD (/ pi 2))); = Copy & Pan Up
(defun C:CPL () (CPDD pi)); = Copy & Pan Left
(defun C:CPD () (CPDD (* pi 1.5))); = Copy & Pan Down
Kent Cooper, AIA