MS13 Posted November 28, 2018 Share Posted November 28, 2018 I am using this to align texts and match elevations Quote (defun C:CH (/ e d s c v l -ch10) (defun -ch10 (e i v / d n) (setq d (cdr (assoc 10 (entget e)))) (setq n (cond ( (= "X" i)(list v (cadr d)(caddr d))) ( (= "Y" i)(list (car d) v (caddr d))) ( (= "Z" i)(list (car d)(cadr d) v)) (t v) ) ) (cd:ENT_SetDXF e 10 n) ) (if (and (setq e (entsel "\Choose source text: ")) (wcmatch (cdr (assoc 0 (setq d (entget (car e))))) "*TEXT") ) (progn (redraw (car e) 3) (setq v (cdr (assoc 10 d))) (princ (strcat "\Change the coordinates of the insertion" " [X=" (cd:CON_Real2Str (car v) 2 nil) ", Y=" (cd:CON_Real2Str (cadr v) 2 nil) ", Z=" (cd:CON_Real2Str (caddr v) 2 nil) "]" ) ) (if (setq s (ssget ":L" '((0 . "*TEXT")))) (if (setq c (cd:USR_GetKeyWord "\Choose coordinate to change" '("X" "Y" "Z" "All" "End") "Z") ) (if (= c "End") (princ "Choose ") (progn (setq l (cd:SSX_Convert s 0)) (cd:SYS_UndoBegin) (foreach % l (cond ( (= c "X")(-ch10 % c (car v))) ( (= c "Y")(-ch10 % c (cadr v))) ( (= c "Z")(-ch10 % c (caddr v))) ( (= c "All")(-ch10 % "W" v)) (t nil) ) ) (cd:SYS_UndoEnd) ) ) (princ "\Cancelled. ") ) (princ "\No choice. ") ) ) (princ "\No choice. ") ) (redraw (car e) 4) (princ) ) In this lisp source could be only text or mtext. The thing is to add to this lisp a block as a source. So text OR block would be a reference object Quote Link to comment Share on other sites More sharing options...
ronjonp Posted November 29, 2018 Share Posted November 29, 2018 You should ask the person that wrote the code to modify this .. there are several subfunctions missing ( cd:* ). Quote Link to comment Share on other sites More sharing options...
MS13 Posted February 1, 2019 Author Share Posted February 1, 2019 Sorted. Please close topic 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.