souvik Posted October 19, 2013 Author Posted October 19, 2013 Here is the sample....... Sample1.dwg Quote
eldon Posted October 19, 2013 Posted October 19, 2013 If you can't get the lisp to work, the suggestion by steven-g in post #12 is excellent Quote
souvik Posted October 20, 2013 Author Posted October 20, 2013 If you can't get the lisp to work, the suggestion by steven-g in post #12 is excellent Could you please tell me process to work with the lisp.. Quote
eldon Posted October 20, 2013 Posted October 20, 2013 I am afraid that I can't tell you how the lisp works, because I did not use it. I used the method of changing the UCS. Quote
GP_ Posted October 20, 2013 Posted October 20, 2013 Here is the sample....... *@*#|^@#* (censored) "Points with z value labelled" I thought points with fields. Quote
pBe Posted October 20, 2013 Posted October 20, 2013 *@*#|^@#* (censored) "Points with z value labelled" I thought points with fields. That's the reason why i hold off writing a code for this request. Nice idea BTW _GP Quote
GP_ Posted October 20, 2013 Posted October 20, 2013 (edited) Thank you, pBe @souvik Try this code for points and mtexts. (defun c:TesT (/ cmd p&t L n L1 L2 p_t ep_t :p1 :p2 :p1z ) (vl-load-com) (setq cmd (getvar 'cmdecho)) (setvar 'cmdecho 0) (command "_.undo" "_begin") (if (and (princ "\nSelect points and mtexts to align") (setq p&t (ssget '((0 . "POINT,MTEXT")))) (setq L (car (entsel "\nSelect the reference line"))) (= "LINE" (cdr (assoc 0 (entget L)))) (or oL (setq oL 0.00)) (setq oL (cond ( (getdist (strcat "\nOffset from the line <" (rtos oL 2 2) ">: ")) ) ( oL ) ) ) ) (progn (setq L1 (cdr (assoc 10 (entget L)))) (setq L2 (cdr (assoc 11 (entget L)))) (setq L1 (list (car L1) (cadr L1))) (setq L2 (list (car L2) (cadr L2))) (repeat (setq n (sslength p&t)) (setq p_t (ssname p&t (setq n (1- n)))) (setq :p1 (cdr (assoc 10 (setq ep_t (entget p_t))))) (setq :p1z (last :p1) :p1 (list (car :p1) (cadr :p1))) (setq :p2 (LM:ProjectPointToLine :p1 L1 L2)) (if (not (equal oL 0.0 1e-6)) (setq :p2 (polar :p2 (angle :p2 :p1) oL))) (if (= "POINT" (cdr (assoc 0 ep_t))) (progn (setq :p2 (list (car :p2) (cadr :p2) :p1z)) (vla-put-Coordinates (vlax-ename->vla-object p_t) (vlax-3d-point :p2)) ) (progn (setq :p2 (list (car :p2) (cadr :p2) :p1z)) (setq :p2 (polar :p2 (angle :p2 :p1) (* 1.7 (cdr (assoc 40 ep_t))))) (vla-put-InsertionPoint (vlax-ename->vla-object p_t) (vlax-3d-point :p2)) ) ) ) ) ) (setvar 'cmdecho cmd) (command "_.undo" "_end") (princ) ) ;; Project Point onto Line - Lee Mac ;; Projects pt onto the line defined by p1,p2 (defun LM:ProjectPointToLine ( pt p1 p2 / nm ) (setq nm (mapcar '- p2 p1) p1 (trans p1 0 nm) pt (trans pt 0 nm) ) (trans (list (car p1) (cadr p1) (caddr pt)) nm 0) ) Edited October 20, 2013 by GP_ 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.