BIGAL Posted August 25, 2017 Posted August 25, 2017 (edited) This was question in another post but I thought I would have a go at something, it uses a simple method 2x40 copy objects 2 times in the X direction 40 apart, it works for Y as well, it is written with ortho in mind ie X & Y axis but works on an angle if you use a temporary UCS. It supports 2x-40 to go other way. It may be usefull. ; copy multiple objects along x or y axis ; use 2x40 etc ; by Alan H aug 2017 (defun c:cd ( / ss num ans) (defun copyx ( / x) (setq howmany (atoi (substr ans 1 num))) (setq dist (atof (substr ans (+ num 2)(- (strlen ans) (+ num 1))))) (setq x 1.0) (repeat howmany (command "copy" ss "" (list 0 0) (list (* dist x) 0)) (setq x (+ x 1.0)) ) (setq ss nil) ) (defun copyy () (setq howmany (atoi (substr ans 1 num))) (setq dist (atof (substr ans (+ num 2)(- (strlen ans) (+ num 1))))) (setq x 1.0) (repeat howmany (command "copy" ss "" (list 0 0) (list 0 (* dist x) )) (setq x (+ x 1.0)) ) (setq ss nil) ) (princ "\nPlease pick objects <Cr> to exit") (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (while (/= (setq ss (ssget)) nil) (setq ans (strcase (getstring "Enter num XY offset 2x40"))) (cond ((/= (setq num (vl-string-search "X" ans )) nil)(copyx)) ((/= (setq num (vl-string-search "Y" ans )) nil)(copyy)) (alert "You have Entered an incorrect value") ) ) ) Edited August 26, 2017 by BIGAL Quote
rkent Posted August 25, 2017 Posted August 25, 2017 Is this the same function as a rectangular array? Quote
BIGAL Posted August 26, 2017 Author Posted August 26, 2017 (edited) No it was done purposely to not use array command rather a simplified version of copying an object in x & y directions you can do 1x40 copy 1 object +40 in X direction. It would be used by people who stuff like bolt holes in patterns, it will work on angles as well, provided you set the ucs. Something like this starting with bottom right circle, 1y100 copy up, L copy across 1x-100 L then 3x-50 L 1x-100 L 1y-50 Using the L LAST and Enter key is a fast way of repeating using an object like a circle. Edited August 27, 2017 by BIGAL Quote
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.