Juergen Posted March 6, 2023 Author Posted March 6, 2023 Sorry but it doesn't work. I believe the new version is the same as before. Thanks. Quote
BIGAL Posted March 6, 2023 Posted March 6, 2023 Code updated again found a couple more hiccups should be right now. Quote
Juergen Posted March 7, 2023 Author Posted March 7, 2023 Hi Bigal, can you please post the program again. Thanks. Quote
BIGAL Posted March 7, 2023 Posted March 7, 2023 I did in the previous post so only 1 version of the code exists. Quote
Juergen Posted March 8, 2023 Author Posted March 8, 2023 Ok I understand. But it still doesn't work. I still get the message "no objects found" Quote
Tsuky Posted March 8, 2023 Posted March 8, 2023 (edited) @Juergen If you have a non-English version of Autocad, try internationalizing the commands in the code: (setq ss (ssget "F" (list pt1 pt2) '((0 . "LWPOLYLINE")))) -> (setq ss (ssget "_F" (list pt1 pt2) '((0 . "LWPOLYLINE")))) (setq ss2 (ssget "wP" co-ord)) -> (setq ss2 (ssget "_wP" co-ord)) (command "copy" ss2 "" "0,0" (list dist 0.0)) -> (command "_.copy" ss2 "" "0,0" (list dist 0.0)) Edited March 8, 2023 by Tsuky Quote
Juergen Posted March 8, 2023 Author Posted March 8, 2023 Hi Tsuky, thanks for your help, it works! What is to add when I want a customer entry? "(setq x 0 dist 50.0) ; maybe add a enter dist" And also a big thanks to Bigal. Quote
Tsuky Posted March 8, 2023 Posted March 8, 2023 Replace (setq x 0 dist 50.0) ; maybe add a enter dist by (setq x 0) (initget 7) (setq dist (getdist pt1 "\nDistance for copy?: ")) and (setq x (1+ x) dist (+ 50 dist)) by (setq x (1+ x) dist (+ dist dist)) Quote
BIGAL Posted March 8, 2023 Posted March 8, 2023 Not sure what happened I updated code but just had a look and it was wrong so updated again it has a while so can run multiple times. I know needs a Y offset if ran multi times. Not sure if needed. (setq dist (getdist "\nEnter distance ")) (setq d2 dist) (while (setq pt1 (getpoint "\nPick 1st point Enter to exit ")) Quote
Juergen Posted March 9, 2023 Author Posted March 9, 2023 Hello Bigal, thanks for your update. A y shift with "dist" wouldn't be bad. What and where should i put this in? Quote
BIGAL Posted March 10, 2023 Posted March 10, 2023 Updated code in my other post to allow for Y offset. Quote
Juergen Posted June 1, 2023 Author Posted June 1, 2023 Hi, I use the code from AlanH. Please see my image. Is it possible to bring the objects in one line? Thanks for help. ; very simple copy plines and whats inside to right ; By AlanH March 2023 (defun c:wow2 ( / pt1 pt2 ss ss2 x dist oldsnap) (setq pt1 (getpoint "\Pick 1st point ") pt2 (getpoint pt1 "\nPick point 2 ")) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq x 0) (initget 7) (setq dist (getdist pt1 "\nDistance for copy?: ")) (setq ss (ssget "_F" (list pt1 pt2) '((0 . "LWPOLYLINE")))) (if (= ss nil) (alert "No objects found") (repeat (sslength ss) (setq plent (ssname ss x)) (setq co-ord (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) (entget plent)))) (setq co-ord (cons (last co-ord) co-ord)) ; make a closed list (setq ss2 (ssget "_wP" co-ord)) (setq ss2 (ssadd plent ss2)) (command "_.move" ss2 "" "0,-20000" (list dist 0.0)) (setq x (1+ x) dist (+ 2000 dist)) ) ) (setvar 'osmode oldsnap) (princ) ) (c:wow2) 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.