INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

label object in ACAD with i.e. object's length

label object in ACAD with i.e. object's length

(OP)
hi everybody, i wanted to use this script i found at http://204.101.252.14/library/lisplo.html but it didn't do what i needed. does anyone know how to retrieve the attribute (like length) of an ACAD-object (like arc, polyline, line) using a LISP-command? gotten so far as the script put a label with the number of selected items. would be a handy tool to measure items in one's drawing (i.e. for a quantity survey task). code so far as follows...

CODE

;LABEL.LSP (c) 1989 CADHELP! (206) 871-7672
;4390 E. Collins Rd., Port Orchard, WA 98366
;Also available **CIVIL/SURVEY for AutoCAD**
;Lisp programs for Civil Engineer & Surveyors
;See Dec. CADENCE article. Write or call for information.
;Use this routine is to label contour lines that have been
;digitized onto the drawing use, OSNAP NEAR to select the
;desired location of the label, then drag the rotation angle
;of the text to align parallel with the contour line.
(vmon)
(prompt "\nLoading..")
;pick contour & align text
(defun locate ()
 (setq p1 (getpoint "\nLabel location:")
 )
)
(princ ".")
;set the text height
(defun textht ()
 (setq t1 "Text Height: <default = "
       t2 " >:"
       t3 (getvar "textsize")
 )
 (terpri)
 (setq ht (getreal (strcat t1 (rtos t3 2 2) t2)))
 (if (= ht nil)
  (setq ht t3)
 )
)
(princ ".")
;insert the elevation
(defun insrt ()
 (command "circle" p1 (* ht 1.5)
          "text" "m" p1 ht 0 e1
 )
)
(princ ".")
(defun C:LABEL ()
 (setq auswahl (ssget "_:S"))
 (setq e1 (sslength auswahl))
 (locate)
 (insrt)
)
(princ)

RE: label object in ACAD with i.e. object's length

(OP)
note that i modified original script already a little
so don't blame the guys from the header of the script winky smile

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close