0% found this document useful (0 votes)
23 views2 pages

Text Align

a cad script to align text

Uploaded by

Siddharth Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Text Align

a cad script to align text

Uploaded by

Siddharth Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

;; Text 2 Point - Lee Mac 2012

;; Prompts for a selection of Text and Point entities and moves


;; each Text entity to the nearest (2D distance) Point entity in the set.
;;
;; Retains existing Text elevation.

(defun c:txt2pt ( / _textinsertion di1 di2 dxf ent inc ins lst mpt pnt sel txt )

(defun _textinsertion ( elist )


(if
(and
(zerop (cdr (assoc 72 elist)))
(zerop (cdr (assoc 73 elist)))
)
(cdr (assoc 10 elist))
(cdr (assoc 11 elist))
)
)

(if (setq sel (ssget "_:L" '((0 . "POINT,TEXT"))))


(progn
(repeat (setq inc (sslength sel))
(setq ent (entget (ssname sel (setq inc (1- inc)))))
(if (eq "POINT" (cdr (assoc 0 ent)))
(setq lst (cons (cdr (assoc 10 ent)) lst))
(setq txt (cons (cons (_textinsertion ent) ent) txt))
)
)
(foreach ent txt
(setq ins (list (caar ent) (cadar ent)))
(if (setq pnt (vl-some '(lambda ( pnt ) (equal ins (list (car pnt)
(cadr pnt)) 1e-8)) lst))
(setq lst (vl-remove pnt lst))
(progn
(setq di1 (distance ins (list (caar lst) (cadar lst)))
mpt (car lst)
)
(foreach pnt (cdr lst)
(if (< (setq di2 (distance ins (list (car pnt) (cadr
pnt)))) di1)
(setq di1 di2
mpt pnt
)
)
)
(setq pnt (list (car mpt) (cadr mpt) (caddar ent))
dxf (cdr ent)
dxf (subst (cons 10 pnt) (assoc 10 dxf) dxf)
dxf (subst (cons 11 pnt) (assoc 11 dxf) dxf)
)
(entmod dxf)
(setq lst (vl-remove mpt lst))
)
)
)
)
)
(princ)
)
(vl-load-com) (princ)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy