Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

hey every one I have lisp which aligning text to polyline parallel,perpendicula

1 REPLY 1
SOLVED
Reply
Message 1 of 2
iftikhargulmrd
392 Views, 1 Reply

hey every one I have lisp which aligning text to polyline parallel,perpendicula

iftikhargulmrd
Enthusiast
Enthusiast

 

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

0 Likes

hey every one I have lisp which aligning text to polyline parallel,perpendicula

 

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

1 REPLY 1
Message 2 of 2
imadHabash
in reply to: iftikhargulmrd

imadHabash
Mentor
Mentor
Accepted solution

Hi,

would you check this great link here and see if it's help . >> Click <<

 

 

Imad Habash

EESignature

0 Likes

Hi,

would you check this great link here and see if it's help . >> Click <<

 

 

Imad Habash

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report