EntDraught Posted August 4, 2012 Share Posted August 4, 2012 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... thanks in advance! Quote Link to comment Share on other sites More sharing options...
MSasu Posted August 4, 2012 Share Posted August 4, 2012 Since the copy step is constant, why don't use the ARRAY command instead? Quote Link to comment Share on other sites More sharing options...
RobDraw Posted August 6, 2012 Share Posted August 6, 2012 Psst MSasu... the OP said, 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. Quote Link to comment Share on other sites More sharing options...
SAFeSTeR Posted August 6, 2012 Share Posted August 6, 2012 Toaster OVEN? I think you have just invented it... Quote Link to comment Share on other sites More sharing options...
RobDraw Posted August 6, 2012 Share Posted August 6, 2012 I would use temporary tracking points, but that could be a lot of clicking. Quote Link to comment Share on other sites More sharing options...
EntDraught Posted August 6, 2012 Author Share Posted August 6, 2012 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... Quote Link to comment Share on other sites More sharing options...
EntDraught Posted August 6, 2012 Author Share Posted August 6, 2012 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, Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 6, 2012 Share Posted August 6, 2012 Here is a relatively simple program: (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) ) (vl-load-com) (princ) Or, if you have Express Tools installed: (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)) (setq s (ssadd)) (foreach x l (vla-move (setq o (vla-copy x)) b (vlax-3D-point (trans q 1 0))) (ssadd (vlax-vla-object->ename o) s) ) (setq p q) ) ) ) (princ) ) (vl-load-com) (princ) Quote Link to comment Share on other sites More sharing options...
EntDraught Posted August 6, 2012 Author Share Posted August 6, 2012 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, Quote Link to comment Share on other sites More sharing options...
BlackBox Posted August 6, 2012 Share Posted August 6, 2012 Nice, Lee... I also use acet-ss-drag-move and acet-ss-drag-rotate for my CopyRotate (CORO) Command. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 7, 2012 Share Posted August 7, 2012 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, You're very welcome EntDraught, the programs were relatively short and quick to write, so I didn't mind offering a helping hand Nice, Lee... I also use acet-ss-drag-move and acet-ss-drag-rotate for my CopyRotate (CORO) Command. Thanks RenderMan; the acet-* functions are indeed an incredibly useful alternative to using functions such as grread to create the same visual effect, that is, providing that you can guarantee that Express Tools will be available. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted August 7, 2012 Share Posted August 7, 2012 Thanks RenderMan; the acet-* functions are indeed an incredibly useful alternative to using functions such as grread to create the same visual effect, that is, providing that you can guarantee that Express Tools will be available. I am fortunate to work with a Vertical, which comes with Express Tools OOTB I believe, and if not, IT installs for each version anyway (LoL). They just restrict us on 3rd party, or non-supported Autodesk plug-ins unfortunately. In any event, you've done another (technically, two) fine job(s) here. Cheers! Quote Link to comment Share on other sites More sharing options...
lutzow10 Posted November 2, 2017 Share Posted November 2, 2017 So I know this post is old but I would love if someone could help me with edit the lisp posted by Lee Mac. I am using AutoCAD 2018 with express tools and the lisp works up until the second copy. I can't control the direction of the copy. I am using it now to quickly draw a column grid. I have orthomode on. My first copy is horizontal, the second is also to be horizontal and all visual cues show as if it will be copied horizontally, just like the other copy. However, the result is that it copies the object downward. And not even to the correct distance. For example I typed in 20'-8" and it copied it 7' something down on the Y-axis. This is exactly what I am looking for so if anyone can help me out with this it would be fantastic!! Quote Link to comment Share on other sites More sharing options...
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.