+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Junior Member
    Using
    AutoCAD 2008
    Join Date
    Jun 2012
    Posts
    12

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

    thanks in advance!

  2. #2
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,007

    Default

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

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  3. #3
    Super Member RobDraw's Avatar
    Using
    AutoCAD 2011
    Join Date
    Apr 2007
    Location
    Connecticut, USA
    Posts
    1,239

    Default

    Psst MSasu... the OP said,

    Quote Originally Posted by EntDraught View Post
    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.
    Rob

  4. #4
    Full Member
    Computer Details
    SAFeSTeR's Computer Details
    Operating System:
    Windows 7
    Discipline
    Utilities
    SAFeSTeR's Discipline Details
    Occupation
    Overhead Cable CAD Technician
    Discipline
    Utilities
    Using
    AutoCAD 2012
    Join Date
    Jul 2012
    Location
    London, England
    Posts
    86

    Default

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

  5. #5
    Super Member RobDraw's Avatar
    Using
    AutoCAD 2011
    Join Date
    Apr 2007
    Location
    Connecticut, USA
    Posts
    1,239

    Default

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

  6. #6
    Junior Member
    Using
    AutoCAD 2008
    Join Date
    Jun 2012
    Posts
    12

    Default

    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. #7
    Junior Member
    Using
    AutoCAD 2008
    Join Date
    Jun 2012
    Posts
    12

    Default

    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. #8
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    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)
    )
    (vl-load-com)
    (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))
                    (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)
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  9. #9
    Junior Member
    Using
    AutoCAD 2008
    Join Date
    Jun 2012
    Posts
    12

    Default

    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. #10
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,952

    Default

    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.
    "Potential has a shelf life." - Margaret Atwood

Similar Threads

  1. COPY or ** COPY ** - Copy and Stretch, Move, Rotate, Scale & Mirror objects
    By Andrew1979 in forum Tutorials & Tips'n'Tricks
    Replies: 2
    Last Post: 27th Jul 2009, 07:36 am
  2. Copy Function
    By ged w in forum AutoCAD General
    Replies: 3
    Last Post: 19th Oct 2008, 03:30 pm
  3. Replies: 10
    Last Post: 24th May 2007, 09:34 am
  4. Key function of copy
    By Repeat offender in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 4th Apr 2007, 06:54 pm
  5. copy the polyline features using vla function
    By vivekgrs in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 29th Sep 2006, 05:38 am

Bookmarks

Posting Permissions

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