hey every one
I have lisp which aligning text to polyline parallel but I want to perpendicular
(defun c:foo (/ _aap l lines p p2 ss text)
;; RJP - 6.14.2017
(defun _aap (ename pt / param)
(if (and (not (vl-catch-all-error-p (vl-catch-all-apply 'vlax-curve-getendparam (list ename))))
(setq param (vlax-curve-getparamatpoint ename pt))
)
(angle '(0 0) (vlax-curve-getfirstderiv ename param))
)
)
(if (setq ss (ssget '((0 . "*polyline,Line,Text"))))
(progn (foreach x (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
(if (= "TEXT" (cdr (assoc 0 (entget x))))
(setq text (cons x text))
(setq lines (cons x lines))
)
)
(if lines
(foreach x text
(setq p (cdr (assoc 10 (entget x))))
(setq
l (mapcar
'(lambda (x)
(list (setq p2 (vlax-curve-getclosestpointto x p)) (distance p p2) (_aap x p2))
)
lines
)
)
(setq l (car (vl-sort l '(lambda (a b) (< (cadr a) (cadr b))))))
(entmod (subst (cons 50 (caddr l)) (assoc 50 (entget x)) (entget x)))
)
)
)
)
(princ)
) but I want to be perpendicular
Solved! Go to Solution.
hey every one
I have lisp which aligning text to polyline parallel but I want to perpendicular
(defun c:foo (/ _aap l lines p p2 ss text)
;; RJP - 6.14.2017
(defun _aap (ename pt / param)
(if (and (not (vl-catch-all-error-p (vl-catch-all-apply 'vlax-curve-getendparam (list ename))))
(setq param (vlax-curve-getparamatpoint ename pt))
)
(angle '(0 0) (vlax-curve-getfirstderiv ename param))
)
)
(if (setq ss (ssget '((0 . "*polyline,Line,Text"))))
(progn (foreach x (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
(if (= "TEXT" (cdr (assoc 0 (entget x))))
(setq text (cons x text))
(setq lines (cons x lines))
)
)
(if lines
(foreach x text
(setq p (cdr (assoc 10 (entget x))))
(setq
l (mapcar
'(lambda (x)
(list (setq p2 (vlax-curve-getclosestpointto x p)) (distance p p2) (_aap x p2))
)
lines
)
)
(setq l (car (vl-sort l '(lambda (a b) (< (cadr a) (cadr b))))))
(entmod (subst (cons 50 (caddr l)) (assoc 50 (entget x)) (entget x)))
)
)
)
)
(princ)
) but I want to be perpendicular
Solved! Go to Solution.
Solved by imadHabash. Go to Solution.
Can't find what you're looking for? Ask the community or share your knowledge.