# Thread: Copy relative to last copy location function?

1. ## Copy relative to last copy location function?

Registered forum members do not see this ad.

Hi Guys,

You know how on the copy command you can select a general direction and keep copying relative to the base point? Well, I'd like to do that but would like the copy distance to be relative to the last copy point.

In case it's not clear I'll offer an example:

Create a circle at points 0,0,0.

I would like to copy the circle every 10 ft. along the x axis for 100 ft. Instead of continually entering copy points of 10,20,30,40,50 etc. from the base point of 0,0,0 I would like to start at 0,0,0 but enter [copy] and for distances enter 10,10,10,10 and have each copied circle advance from the last copy's point 10 feet or whatever distance I need.

In real life these points for me would vary so it wouldn't be a constant 10 ft., or an even length, it would vary.

It seems like a simple LISP routine could handle this but I would like to know if this function exists within autocad before I reinvent the toaster oven...

2. Since the copy step is constant, why don't use the ARRAY command instead?

3. Psst MSasu... the OP said,

Originally Posted by EntDraught
In real life these points for me would vary so it wouldn't be a constant 10 ft., or an even length, it would vary.

4. Toaster OVEN? I think you have just invented it...

5. I would use temporary tracking points, but that could be a lot of clicking.

6. Never heard of a toaster oven (not a toaster)? I'm starting to feel old now and I'm just in my mid 30's...

7. Sounds like there's nothing native in cad for this command so I'll just draft up a lisp - should be pretty straight forward.

Thanks,

8. Here is a relatively simple program:

Code:
```(defun c:copyrel ( / b i l p q s )
(if
(and
(setq s (ssget "_:L"))
(setq p (getpoint "\nSpecify Base Point: "))
(setq b (vlax-3D-point (trans p 1 0)))
)
(progn
(repeat (setq i (sslength s))
(setq l (cons (vlax-ename->vla-object (ssname s (setq i (1- i)))) l))
)
(while (setq q (getpoint "\nSpecify Second Point: " p))
(foreach x l (vla-move (vla-copy x) b (vlax-3D-point (trans q 1 0))))
(setq p q)
)
)
)
(princ)
)
(princ)```
Or, if you have Express Tools installed:

Code:
```(defun c:copyrel ( / b i l o p q s )
(if
(and
(setq s (ssget "_:L"))
(setq p (getpoint "\nSpecify Base Point: "))
(setq b (vlax-3D-point (trans p 1 0)))
)
(progn
(repeat (setq i (sslength s))
(setq l (cons (vlax-ename->vla-object (ssname s (setq i (1- i)))) l))
)
(while (setq q (acet-ss-drag-move s p "\nSpecify Second Point: " 0 0))
(foreach x l
(vla-move (setq o (vla-copy x)) b (vlax-3D-point (trans q 1 0)))
)
(setq p q)
)
)
)
(princ)
)
(princ)```

9. Lee Mac, now you've gone and done it... I've been attempting new things lately and have come across older posts where you most generously offer assistance to others and now you've gone and done it to me!

God Bless you,

10. Registered forum members do not see this ad.

Nice, Lee... I also use acet-ss-drag-move and acet-ss-drag-rotate for my CopyRotate (CORO) Command.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts