Jump to content

annotating line entities


student21

Recommended Posts

Need help,

 

I found this program that does pretty much what I need it

to do, but I would like it to use the current text style instead

of using "standard" and more importantly I need it to put the

text at the "midpoint" of the line or lines either above or below.

 

Thank you much

 

(defun c:LINELENGTH ( / CONST_STYLE CONST_TXT-HT CONT COUNT DIST ENT IP LAYER ROT SS)
(if (setq ss (ssget))
(progn
(setq count 0)
(repeat (sslength ss)
(setq cont (entget (ssname ss count)))
(if (= "LINE" (cdr (assoc 0 cont)))
(progn
(setq CONST_txt-ht 1.0
CONST_style "LY080"
layer (cdr (assoc 8 cont))
ip (cdr (assoc 10 cont))
rot (angle (cdr (assoc 10 cont)) (cdr (assoc 11 cont)))
dist (distance (cdr (assoc 10 cont)) (cdr (assoc 11 cont)))
ent (list
(cons 0 "MTEXT")
(cons 100 "AcDbEntity")
(cons 8 layer)
(cons 100 "AcDbMText")
(cons 10 ip)
(cons 40 CONST_txt-ht)
(cons 41 dist)
(cons 71 7)
(cons 72 5)
(cons 1 (rtos dist 2))
(cons 7 CONST_style)
(list 210 0.0 0.0 1.0)
(cons 11 (cdr (assoc 11 cont)))
(cons 50 rot)
(cons 73 1)
(cons 44 1.0)
)
)
(entmake ent)
)
)
(setq count (1+ count))
)
)
)
)
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...