Jump to content

Dynamic multiple copy


Recommended Posts

Posted

More years ago than I care to admit I seem to remember using AutoCAD in college there was a command that would allow you to copy an object N times. It worked something like:

command_name (MCOPY maybe?)

enter number of copies> 10

select object> (click on object)

specify basepoint>

specify second point>

 

After entering the basepoint, the number of copies that you entered would appear on the screen and as you moved the mouse, they would stretch across the screen. It was like a hybrid of the copy and array command, but it worked dynamically, real time, so you could see your objects get farther apart in the direction you moved the mouse.

 

1. Does anyone know of such a command that currently exists?

2. Did such a command ever exist?

 

Glen

Posted
More years ago than I care to admit I seem to remember using AutoCAD in college there was a command that would allow you to copy an object N times. It worked something like:

command_name (MCOPY maybe?)

enter number of copies> 10

select object> (click on object)

specify basepoint>

specify second point>

 

After entering the basepoint, the number of copies that you entered would appear on the screen and as you moved the mouse, they would stretch across the screen. It was like a hybrid of the copy and array command, but it worked dynamically, real time, so you could see your objects get farther apart in the direction you moved the mouse.

 

1. Does anyone know of such a command that currently exists?

2. Did such a command ever exist?

 

Glen

I have MCOPY but it doesn't dynamically stretch in real time. It does everything else you're asking for tho. Want it anyways?

Posted

MCOPY doesn't exist in Mechanical 2009. I'm not sure if you're confusing it with COPY>M which you had to input if you wanted to place a copy at multiple points? The points were not related other than to the basepoint.

 

This has been replaced and now the command acts as if the M had been entered, and the command runs until it's cancelled.

 

Hope that makes sense?

 

EDIT actually I've just seen the mention of n times so ignore my above reason.

Posted
I have MCOPY but it doesn't dynamically stretch in real time. It does everything else you're asking for tho. Want it anyways?

 

Yes please! Is this a LISP (I guess it must be.) Perhaps between what you have and a few of Lee's routines I can hack together something that shows real time.

 

I'm thinking that it would be usefull if I had say, 5 control relays to place in a junction box, I could do the math and figure out exactly how much room they take up and what is left over and how far apart to place them - or I can stick one in on one side, run this command and stretch it over.

 

GE13579

Yes I have copy defaulting to multiple, and it works great for a few copies, but if I need to place 64 terminal blocks on a DIN rail it's a lot of clicks, or multiple copy commands with ever increasing selections - and I always lose track of how many I have and need to go back and count them. With this you just tell it 64 copies and 3 clicks later they are all there.

 

Glen

Posted
Yes please! Is this a LISP (I guess it must be.) Perhaps between what you have and a few of Lee's routines I can hack together something that shows real time.

 

I'm thinking that it would be usefull if I had say, 5 control relays to place in a junction box, I could do the math and figure out exactly how much room they take up and what is left over and how far apart to place them - or I can stick one in on one side, run this command and stretch it over.

 

GE13579

Yes I have copy defaulting to multiple, and it works great for a few copies, but if I need to place 64 terminal blocks on a DIN rail it's a lot of clicks, or multiple copy commands with ever increasing selections - and I always lose track of how many I have and need to go back and count them. With this you just tell it 64 copies and 3 clicks later they are all there.

 

Glen

Here you go....

MCOPY.LSP

Posted
...With this you just tell it 64 copies and 3 clicks later they are all there...

 

Yeah when I saw Styk's reply and re read your question I realised I was way off the mark... :oops:

 

Sounds interesting I can imagine it saving on some time vs array just being able to snap the distance/ without the dialogue box...

 

I'd be interested in seeing this too if it's a ready made lisp?

Posted

StykFacE, THANK YOU!

 

This gets me most of the way to where I want to be. Getting it to display real time will be left to when I get some of the rare element "free time".

 

This place is great.

 

Glen

Posted (edited)

Nice routine Tannar.

 

Here's a rewrite I did a while back of an old Land Desktop routine. Similar to MCopy, but it will allow you to change the distance with each copy. Just thought I'd add it.

;;; ------------------------------------------------------------------------
;;;    ContinuousCopy.lsp v1.0
;;;
;;;    Copyright© 03.06.09
;;;    Alan J. Thompson (alanjt)
;;;
;;;    Permission to use, copy, modify, and distribute this software
;;;    for any purpose and without fee is hereby granted, provided
;;;    that the above copyright notice appears in all copies and
;;;    that both that copyright notice and the limited warranty and
;;;    restricted rights notice below appear in all supporting
;;;    documentation.
;;;
;;;    Modeled after the Land Desktop 'retired' "Continuous Copy" command
;;;    (some coding borrowed from original Land Desktop routine).
;;;    User is able to continuously copy selected object(s) along a
;;;    defined angle & distance. Distance may be changed at any time.
;;;
;;; ------------------------------------------------------------------------

(defun c:CC () (c:ContinuousCopy))
(defun c:ContinuousCopy
      (/ *error* #OldCmdecho #CopyGroup #Angle #Dist #Temp #Ent)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SUBROUTINES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;error handler
 (defun *error* (msg)
   (if
     (not
   (member
     msg
     '("console break" "Function cancelled" "quit / exit abort")
   ) ;_ member
     ) ;_ not
      (princ (strcat "Error: " msg))
   ) ;_ if
   (if    #OldCmdecho
     (setvar "cmdecho" #OldCmdecho)
   ) ;_ if
 ) ;_ defun


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MAIN ROUTINE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 (setq #OldCmdecho (getvar "cmdecho"))
 (setvar "cmdecho" 0)

 (prompt "\nContinuous Copy")
 (if
   (and
     (setq #CopyGroup (ssget ":L"))
     (setq #Angle (getangle "\nAngle for copy: "))
     (setq #Dist (getdist "\nDistance to copy: "))
     (setq #Temp (strcat
           "@"
           (rtos #Dist 2 6)
           "<"
           (angtos #Angle 0 4)
         ) ;_ strcat
     ) ;_ setq
   ) ;_ and
    (while
      (not
    (member #Temp
        (list "Exit" "X" "Quit")
    ) ;_ member
      ) ;_ not
   (setq #Ent (entlast))
   (vl-cmdf "_.copy" #CopyGroup "" "0,0" #Temp)
   (initget 0 "Exit X Quit")
   (setq #Temp (getdist (strcat
                  "\nDistance to copy <"
                  (rtos #Dist 2 2)
                  ">: "
                ) ;_ strcat
           ) ;_ getdist
   ) ;_ setq
   (if
     (and
       #Temp
       (not
         (member #Temp
             (list "Exit" "X" "Quit")
         ) ;_ member
       ) ;_ not
     ) ;_ and
      (setq #Dist #Temp)
   ) ;_ if
   (if
     (not
       (member #Temp
           (list "Exit" "X" "Quit")
       ) ;_ member
     ) ;_ not
      (progn
        (setq #Temp (strcat
              "@"
              (rtos #Dist 2 6)
              "<"
              (angtos #Angle 0 4)
            ) ;_ strcat
        ) ;_ setq
        (setq #CopyGroup (ssadd))
        (while
          (setq #Ent (entnext #Ent))
       (if #Ent
         (setq #CopyGroup (ssadd #Ent #CopyGroup))
       ) ;_ if
        ) ;_ while
      ) ;_ progn
   ) ;_ if
    ) ;_ while
    (princ "\nMissed, try again.")
 ) ;_ if

 (setvar "cmdecho" #OldCmdecho)

 (princ)
) ;_ defun
;|«Visual LISP© Format Options»
(72 2 40 2 T nil 60 9 0 0 0 T T nil T)
;*** DO NOT add text below the comment! ***|;

Edited by alanjt

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...