Stefan BMR Posted June 27, 2016 Share Posted June 27, 2016 I didn't test it. Is it working? It should be. Quote Link to comment Share on other sites More sharing options...
ktbjx Posted June 27, 2016 Author Share Posted June 27, 2016 I didn't test it. Is it working? It should be. i just tested it!!!! it did!!!!! OMG! its so fast! no more copy and paste!!!! you're the man! Quote Link to comment Share on other sites More sharing options...
Stefan BMR Posted June 27, 2016 Share Posted June 27, 2016 Nice... Now... Do you have time to refine it? Just joking... It is late here. Only two things: you should localize all your variable, like start_point etc. And you should check if the selection set is valid. If you don't select any object, you will get an error message. Congratulation for your first lisp. Quote Link to comment Share on other sites More sharing options...
Grrr Posted June 27, 2016 Share Posted June 27, 2016 did i do it wrong sir? I meant to start with something like this: (defun C:test ( / ent elist end1 end2 newend1 newend2 newlst) (while (cond ((not (setq ent (car (entsel "\nSelect line: ")))) (princ "\nYou missed, try again!") ) ((not (eq (cdr (assoc 0 (entget ent))) "LINE")) (princ "\nThe selected object is not a line!") ) (T (setq elist (entget ent)) (setq end1 (cdr (assoc 10 elist))) (setq end2 (cdr (assoc 11 elist))) (setq newend1 (list 10 (car end1) (cadr end1) (cadr end1))) (setq newend2 (list 11 (car end2) (cadr end2) (cadr end2))) (setq newlst (subst (list 10 (car end1) (cadr end1) (cadr end1)) (assoc 10 elist) elist)) (entmod (setq newlst (subst (list 11 (car end2) (cadr end2) (cadr end2)) (assoc 11 newlst) newlst))) (alert (strcat "\nCoordinates changed: \nfrom " (vl-princ-to-string end1 )" to " (vl-princ-to-string (cdr (assoc 10 newlst)) ) " \nfrom " (vl-princ-to-string end2 )" to " (vl-princ-to-string (cdr (assoc 11 newlst)) ) " " ) ) ) ) ) (princ) ) Then when you get how this base code works, study how to transition the single entity's "transformation" into SS iteration. Quote Link to comment Share on other sites More sharing options...
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.