Jump to content

How to copy an object to a specified distance


Recommended Posts

Posted

Hi,
I am a beginner, and I am actually using nanocad, which seems to have very similar basic commands as Autocad. It basically looks so ...
I'd like create a copy of an existing object, such as a rectangle, just beside the original one but at a specific distance.
I am using the copy command which has a parameter for inputting a distance but I never manage to actually copy the new object exactly beside the exiting one at the specified distance. How is this done in Autocad?

Posted (edited)

A couple of ways type copy, pick objects, pick start point, drag mouse, have say ortho on for in X & Y direction, type distance all done.

 

These were written like 40 years ago. If you have this task a lot then Appload add to startup a lisp with code.

 

(defun C:CHX ()
  (SETVAR "CMDECHO" 0)
  (setq sn (getvar "osmode"))
  (command "osnap" "near")
  (princ "\nalters object in X direction")
  (setq ht (getstring "\n What is amount of change: "))
  (setq newht (strcat ht ",0"))
  (while (setq newobj (entsel "\nPoint to object: "))
    (command "move" newobj "" "0,0" newht)
  )
)
;
(defun C:CHY ()
  (SETVAR "CMDECHO" 0)
  (setq sn (getvar "osmode"))
  (command "osnap" "near")
  (princ "alters object in Y direction")
  (setq ht (getstring "\n What is amount of change: "))
  (setq newht (strcat  "0," ht))
  (while (SETQ NEWobj (entsel "\nPoint to object: "))
    (command "move" newobj "" "0,0" newht)
  )
)

;simple routine to change objects in the z direction
(defun C:CHZ ()
  (SETVAR "CMDECHO" 0)
  (setq sn (getvar "osmode"))
  (command "osnap" "near")
  (setq x 0)
  (princ "alters object in Z direction")
  (setq ht (getstring "\n What is amount of change: "))
  (setq newht (strcat "0,0," ht))
  (while (SETQ NEWobj (entsel "\nPoint to object: "))
    (command "move" newobj "" "0,0,0" newht)
  )
)

 

Edited by BIGAL

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