Stefan BMR Posted June 27, 2016 Posted June 27, 2016 Now you can update the line with the new position: (entmod el) Quote
Stefan BMR Posted June 27, 2016 Posted June 27, 2016 Then increase the counter (setq i (+ 1 i)) and close the loop. Quote
Stefan BMR Posted June 27, 2016 Posted June 27, 2016 I'm out for 10 minutes. Keep me updated with your progress. Quote
ktbjx Posted June 27, 2016 Author Posted June 27, 2016 I'm out for 10 minutes. Keep me updated with your progress. i came up with this! (defun c:test ( / ss n i e el) (setq ss (ssget "_:L" '((0 . "LINE")))) (setq i 0) (setq n (sslength ss)) (while (< i n) (setq e (ssname ss i)) (setq el (subst new_end_point end_point el)) ( (-1 . <Entity name: 7ff6db706600>) (0 . "LINE") (330 . <Entity name: 7ff6db7051f0>) (5 . "1E8") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbLine") (10 19.2702 -4.33456 -4.33456) (11 20.351 -13.4291 -13.4291) (210 0.0 0.0 1.0) ) (setq start_point (assoc 10 el)) (setq new_start_point (list 10 (cadr start_point) (caddr start_point) (caddr_start_point))) (entmod el) (setq i (+ 1 i)) ) (princ) ) is it wrong? Quote
Grrr Posted June 27, 2016 Posted June 27, 2016 Maybe it would be easier if you started with entsel behaviour, and then transition to SS. Quote
ktbjx Posted June 27, 2016 Author Posted June 27, 2016 Maybe it would be easier if you started with entsel behaviour, and then transition to SS. did i do it wrong sir? Quote
Stefan BMR Posted June 27, 2016 Posted June 27, 2016 Delete this part ( (-1 . <Entity name: 7ff6db706600>) (0 . "LINE") (330 . <Entity name: 7ff6db7051f0>) (5 . "1E8") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbLine") (10 19.2702 -4.33456 -4.33456) (11 20.351 -13.4291 -13.4291) (210 0.0 0.0 1.0) ) Quote
Stefan BMR Posted June 27, 2016 Posted June 27, 2016 This is the el value, it is not part of the code. Quote
ktbjx Posted June 27, 2016 Author Posted June 27, 2016 Delete this part ( (-1 . <Entity name: 7ff6db706600>) (0 . "LINE") (330 . <Entity name: 7ff6db7051f0>) (5 . "1E8") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbLine") (10 19.2702 -4.33456 -4.33456) (11 20.351 -13.4291 -13.4291) (210 0.0 0.0 1.0) ) like this??? (defun c:test ( / ss n i e el) (setq ss (ssget "_:L" '((0 . "LINE")))) (setq i 0) (setq n (sslength ss)) (while (< i n) (setq e (ssname ss i)) (setq el (subst new_end_point end_point el)) (setq start_point (assoc 10 el)) (setq new_start_point (list 10 (cadr start_point) (caddr start_point) (caddr_start_point))) (entmod el) (setq i (+ 1 i)) ) (princ) ) Quote
Stefan BMR Posted June 27, 2016 Posted June 27, 2016 Almost. First (setq el... should be (setq el (entget e)) Quote
Stefan BMR Posted June 27, 2016 Posted June 27, 2016 The second goes after (setq new_start_point Quote
Stefan BMR Posted June 27, 2016 Posted June 27, 2016 And this is just the start of the line. You need to do the same with the end, which is (assoc 11 el) Quote
ktbjx Posted June 27, 2016 Author Posted June 27, 2016 (defun c:test ( / ss n i e el) (setq ss (ssget "_:L" '((0 . "LINE")))) (setq i 0) (setq n (sslength ss)) (while (< i n) (setq e (ssname ss i)) (setq el (entget e)) (setq start_point (assoc 10 el)) (setq new_start_point (list 10 (cadr start_point) (caddr start_point) (caddr_start_point))) (setq el (entget e)) (setq start_point (assoc 11 el)) (setq new_start_point (list 11 (cadr start_point) (caddr start_point) (caddr_start_point))) (entmod el) (setq i (+ 1 i)) ) (princ) ) Quote
Stefan BMR Posted June 27, 2016 Posted June 27, 2016 The "second" (setq el should be (setq el (subst new_start_point start_point el)). Then another one just before (entmod el). THERE IS A TYPO in (list 10 (cadr .... The last list should have a space between caddr and start_point. Quote
ktbjx Posted June 27, 2016 Author Posted June 27, 2016 The "second" (setq el should be (setq el (subst new_start_point start_point el)).Then another one just before (entmode el). THERE IS A TYPO in (list 10 (cadr .... The last list should have a space between caddr and start_point. (defun c:test ( / ss n i e el) (setq ss (ssget "_:L" '((0 . "LINE")))) (setq i 0) (setq n (sslength ss)) (while (< i n) (setq e (ssname ss i)) (setq el (entget e)) (setq start_point (assoc 10 el)) (setq new_start_point (list 10 (cadr start_point) (caddr start_point) (caddr start_point))) (setq el setq el (subst new_start_point start_point el)) (setq End_point (assoc 11 el)) (setq new_End_point (list 11 (cadr End_point) (caddr End_point) (caddr End_point))) (entmod el) (setq i (+ 1 i)) ) (princ) ) Quote
Stefan BMR Posted June 27, 2016 Posted June 27, 2016 You have (setq el setq el.... (setq el (subst new_start_point start_point el)) Quote
Stefan BMR Posted June 27, 2016 Posted June 27, 2016 And add this line just before (entmod el) [/i](setq el (subst new_End_point End_point el))[i] Quote
ktbjx Posted June 27, 2016 Author Posted June 27, 2016 You have (setq el setq el.... (setq el (subst new_start_point start_point el)) (defun c:test ( / ss n i e el) (setq ss (ssget "_:L" '((0 . "LINE")))) (setq i 0) (setq n (sslength ss)) (while (< i n) (setq e (ssname ss i)) (setq el (entget e)) (setq start_point (assoc 10 el)) (setq new_start_point (list 10 (cadr start_point) (caddr start_point) (caddr start_point))) (subst new_start_point start_point el) (setq End_point (assoc 11 el)) (setq new_End_point (list 11 (cadr End_point) (caddr End_point) (caddr End_point))) (entmod el) (setq i (+ 1 i)) ) (princ) ) Quote
ktbjx Posted June 27, 2016 Author Posted June 27, 2016 And add this line just before (entmod el) [/i](setq el (subst new_End_point End_point el))[i] i get it now! (defun c:test ( / ss n i e el) (setq ss (ssget "_:L" '((0 . "LINE")))) (setq i 0) (setq n (sslength ss)) (while (< i n) (setq e (ssname ss i)) (setq el (entget e)) (setq start_point (assoc 10 el)) (setq new_start_point (list 10 (cadr start_point) (caddr start_point) (caddr start_point))) (setq el (subst new_start_point start_point el)) (setq End_point (assoc 11 el)) (setq new_End_point (list 11 (cadr End_point) (caddr End_point) (caddr End_point))) (setq el (subst new_End_point End_point el)) (entmod el) (setq i (+ 1 i)) ) (princ) ) 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.